richsmith / sexytopo

The SexyTopo cave surveying app for Android
GNU General Public License v3.0
30 stars 13 forks source link

Add early return in the case of getBitmap() failure #141

Closed danielworkman closed 3 years ago

danielworkman commented 3 years ago

Crash was being caused by getBitmap() returning null (probably failing to load the bitmap resource) and passing a null Bitmap to createScaledBitmap().

This return early is however silently masking the fact that we have a resource issue. Should we at least log this / add an assertion?

richsmith commented 3 years ago

I'm not sure how it can be failing to load the bitmap. All the resources should be bundled in with the package.

Could add a Log.e() but at the moment this would be reporting an error for code that isn't supposed to be active yet, so unhelpful for the user.