MPAndroidChart
MPAndroidChart copied to clipboard
Test for null in entry.getRanges()
If a BarChart has no printed values, the method entry.getRanges() returns null and the method ranges.length throws an exception (null.length). This can simply be prevented by asking the ranges to be not null before asking for length.
PR Checklist:
- [X] I have tested this extensively and it does not break any existing behavior.
- [ ] I have added/updated examples and tests for any new behavior.
- [X] If this is a significant change, an issue has already been created where the problem / solution was discussed: [https://github.com/PhilJay/MPAndroidChart/issues/5054]
PR Description
Check array to be not null before accessing a property of null.
The BarChart does not crash if it has empty values.
It prevents a crash of the app.
I really like this library and using it in my apps, I would like to call people to continue with this awesome thing. I have forked the repo and started working on it! So I am ready as well to accept pull requests, I'll notify other people from here as well! Would be more than happy if we continue with this awesome project.
Code is full kotlin now!
Make your pull requests here: https://github.com/Paget96/MPAndroidChart