Skip to content

NullPointerException serializing array with null element #88

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

Closed
miguel-porto opened this issue Jan 7, 2017 · 5 comments
Closed

NullPointerException serializing array with null element #88

miguel-porto opened this issue Jan 7, 2017 · 5 comments
Assignees
Labels
Milestone

Comments

@miguel-porto
Copy link
Contributor

Hi,
It seems it is not possible to update a document with a bean with an array field with null element, like somefield: [3, null], it throws a NPE!
However, I can do it in AQL, so it's perfectly legal.
Cheers.
Miguel

@mvollmary mvollmary added the bug label Jan 9, 2017
@mvollmary mvollmary self-assigned this Jan 9, 2017
@mvollmary mvollmary added this to the 4.1.5 milestone Jan 9, 2017
@mvollmary
Copy link

Hi,
will be fixed in version 4.1.5 which I will release within this week. You can already use it with 4.1.5-SNAPSHOT.

Thanks & Best
Mark

@miguel-porto
Copy link
Contributor Author

Thanks!
But I can see in the committed code that null array elements now are dropped. This is not consistent with what happens if I do it in AQL, i.e., the array will be saved keeping the null elements, like [3, null]. Is this the desired behavior? IMO null elements should be kept for consistency reasons (e.g. keeping the same array size).
Best,
Miguel

@miguel-porto
Copy link
Contributor Author

Imagine, for example, my array can represent the bars of a bar plot, and null may mean "no data", which is not the same as zero; yet, the space for the bar must be there anyway.

@mvollmary
Copy link

You are totally right. I changed it.

Thanks & Best
Mark

@miguel-porto
Copy link
Contributor Author

Looks perfect now; thanks!
Best,
Miguel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants