NPE in PieGraph.onTouchEvent

Issue #25 resolved
Matthias Urhahn created an issue

Hi Daniel,

through ACRA, I'm getting a NPE that seems to be related to your library. Unfortunately i can't reproduce the issue on my device and going by the amount of reports, it does not appear to be too common.

Stacktrace: http://pastie.org/pastes/8606947/text?key=yph5ehit0g4cxbvgvksyug Codebase of your app being used: https://bitbucket.org/d4rken/holographlibrary-sdm/

You can get a current apk of my app here: http://thedarken.eu/sdmaid/UNSTABLE/

The PieGraphs can be found by selecting the "Overview" section and then tapping the sdcard icon or the gear icon of an entry that lists the free storage.

Specific line that causes the crash: https://bitbucket.org/d4rken/holographlibrary-sdm/src/a3c80c278252/HoloGraphLibrary/src/com/echo/holographlibrary/PieGraph.java?at=master#cl-138

Any thoughts on this? Let me know if you need further information.

Comments (6)

  1. Daniel Nadeau repo owner

    I can't reproduce, but since it's an NPE, there are a couple things that could be suspect. Try implementing a check in the source for slice.getPath() and slice.getRegion(). They shouldn't be null, but you might as well see if this fixes your problem?

  2. Matthias Urhahn reporter

    Wouldn't this crash only be possible if onTouchEvent gets executed before onDraw ?

  3. Daniel Nadeau repo owner

    You are correct... realistically, it wouldn't happen to a user. However, if you would like to avoid it, you could place use a boolean value to check if onDraw has completed.

  4. Log in to comment