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 NPE on createBalanceCache. #232

Merged
merged 1 commit into from
Nov 6, 2021

Conversation

alcarraz
Copy link
Contributor

@alcarraz alcarraz commented Nov 6, 2021

With zero maxId, and if there didn't exist a BalanceCache. The created BalanceCache had a null balance, which in turn triggered an NPE on getBalance0.

This PR ensures a non null balance is set for the newly created balance cache. It is set to ZERO, since if maxId is not zero the next if will set the correct balance, and if maxId is zero the correct balance is zero.

With zero `maxId`, and if there didn't exist a `BalanceCache`. The created `BalanceCache` has a null `balance`, which in turn triggered an NPE on `getBalance0`.
@ar ar merged commit c1da1f1 into jpos:master Nov 6, 2021
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.

2 participants