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

Instant Null Serialization Bug #368

Closed
rhobolic opened this issue Dec 16, 2022 · 3 comments · Fixed by #539
Closed

Instant Null Serialization Bug #368

rhobolic opened this issue Dec 16, 2022 · 3 comments · Fixed by #539

Comments

@rhobolic
Copy link

Problem:
We are using an Instant as temporal. When it comes to com.gruelbox.transactionoutbox.DefaultInvocationSerializer.InstantTypeAdapter a NullPointerException is thrown.
image

Expectation:
The NullPointerException is not thrown

@badgerwithagun
Copy link
Member

Thanks for this! Will take a look

@hashpyrit
Copy link

I'm having the same problem. The object I'm serializing has an Instant field and sometimes that field has a value of null. I'm thinking the problem is here https://github.com/gruelbox/transaction-outbox/blob/master/transactionoutbox-core/src/main/java/com/gruelbox/transactionoutbox/DefaultInvocationSerializer.java#L362
There is no null check before trying to use the DateTimeFormatter. Either that or even before we get to that line we do a null check earlier in the code.

@badgerwithagun
Copy link
Member

I think this might be an issue with an old version of Gson - it was fixed here: google/gson#1555

The version concerned has been a dependency of this library since February 2023, so it's likely that an older version is being pulled in somewhere else in your applications @rhobolic and @hashpyrit.

I've just tested it with the latest version in master and all is well.

I'm going to push the tests I've written anyway was they seem sensible to have.

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

Successfully merging a pull request may close this issue.

3 participants