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

Avoid NullPointerException describing null value #172

Merged
merged 1 commit into from
Jul 26, 2024

Conversation

MikeEdgar
Copy link
Contributor

Fixes #171

Comment on lines +56 to +58
if (expectedValue == null || actualValue == null) {
result.fail(prefix, expectedValue, actualValue);
}
if (areNumbers(expectedValue, actualValue)) {
} else if (areNumbers(expectedValue, actualValue)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed extra "always true" non-null checks and do not attempt to fail for other reasons when already failing due to one value being null.

@MikeEdgar
Copy link
Contributor Author

@carterpage , please take a look.

@carterpage
Copy link
Member

Thanks for the ping. Looks good. I'll try to get this merged and released this weekend.

@davenfroberg
Copy link

@carterpage status on this PR? fixes an issue I'm having (#171)

Signed-off-by: Michael Edgar <michael@xlate.io>
@Azquelt
Copy link

Azquelt commented Jul 22, 2024

I hit this too and was preparing to submit a similar PR.

@carterpage
Copy link
Member

I have been getting new releases going again, and will try to get this included in the new v2 in the next couple of weeks.

@carterpage carterpage merged commit 4e175c3 into skyscreamer:master Jul 26, 2024
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 this pull request may close these issues.

NullPointerException at JSONCompareResult.describe
4 participants