PomepuyN / discreet-app-rate

A lightweight non intrusive app rate reminder for Android
http://nicolaspomepuy.fr/non-intrusive-app-rate
Apache License 2.0
464 stars 51 forks source link

Fixes a possible NPE if the app with the given packageName is not installed #35

Closed writtmeyer closed 9 years ago

writtmeyer commented 9 years ago

If the user of the library calls Apprate.with(activity, packageName) but the package with the given package name is not installed the app crashes with a NPE in line 374. That's because no install date for the package could be retrieved.

In this case this solution falls back to the old way and gets install date by using the current package's install date.

This bug most likely happens only in debug mode when a user is testing his app with a different package name but hasn't yet the proper app installed.