Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with empty objects #556

Closed
bgorhoball opened this issue Oct 14, 2020 · 0 comments
Closed

Error with empty objects #556

bgorhoball opened this issue Oct 14, 2020 · 0 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@bgorhoball
Copy link

We've created a crud datatable just like this example, but when removing data via REST API, with below message:
Screenshot 2020-10-14 121928

  • Cause
    The error is from this line of code, and should be due to the arguments passed into the function resolveFieldData(data, field) - data is an empty object, field is a nested property, which cause the error by accessing the nested properties of an empty object.

  • Suggestion / Solution
    Maybe it's necessary to check if the value of data is an empty object. Tried to update this line of code to
    if (Object.values(data).length && field) {
    and the error is gone.

Not sure if this update will affect other parts of this package, if not, please help update the checking of the value of data in this case. Thank you.

@cagataycivici cagataycivici changed the title DataTable - error when removing data via REST API Error with empty objects Nov 25, 2020
@cagataycivici cagataycivici self-assigned this Nov 25, 2020
@cagataycivici cagataycivici added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Nov 25, 2020
@cagataycivici cagataycivici added this to the 3.0.2 milestone Nov 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

2 participants