-
Notifications
You must be signed in to change notification settings - Fork 5
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
NPE when invalid data is provided #2
Comments
I use the following fix locally to avoid the NPE. Not sure it is the correct one though private BigDecimal maxOf(BigDecimal max, final BigDecimal summaryMax) {
- return max != null ? max.max(summaryMax) : summaryMax;
+ return max != null
+ ? summaryMax != null
+ ? max.max(summaryMax)
+ : max
+ : BigDecimal.ZERO;
}
private BigDecimal minOf(BigDecimal min, final BigDecimal summaryMin) {
- return min != null ? min.min(summaryMin) : summaryMin;
+ return min != null
+ ? summaryMin != null
+ ? min.min(summaryMin)
+ : min
+ : BigDecimal.ZERO;
} |
possibly not; what if every value is null? The result ought to be null, On 9 October 2014 09:02, Martin Grigorov notifications@github.com wrote:
|
returning |
(cherry picked from commit 67038fc0d5ee87ed46f1076b7ec4506af331f2bf)
moved to incodehq/incode-platform#29 |
With the current Java Math demo data in the KitchenSink application trying to show a
summarychart
leads to the following exception:The text was updated successfully, but these errors were encountered: