chore: add triage information for unexplained startup crash #17477
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose / Description
Looking at acrarium, there was a pretty odd crash with a NullPointerException.
Those are usually pretty easy to fix but I couldn't really figure out why on this one:
https://ankidroid.org/acra/app/1/bug/260065/report/ec131296-dcf2-44e3-bd7f-3aa8f34678f6
But external storage appears to be mounted ? So not sure how this returned null.
Maybe there was a race condition between us attempting to access it (while it was still unmounted?) and ACRA attempting to log it and seeing it was mounted by then?
So I don't think we can recover from this but we can provide a custom exception with more information maybe, and can try again later
Fixes
Doesn't fix anything, but shouldn't regress.
Approach
Check for unexpected error condition vs just
!!
ing the value, and try to log useful informationHow Has This Been Tested?
./gradlew jacocoTestReport
and the app still runs on my emulatorLearning (optional, can help others)
Reading lots of API docs
Checklist
Please, go through these checks before submitting the PR.