Skip to content

Commit

Permalink
fix: use 0 as last chance lastVersion fallback for limiter
Browse files Browse the repository at this point in the history
  • Loading branch information
mikehardy authored Aug 31, 2023
1 parent c774637 commit e809d37
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ class LimiterStartupProcessor : HasConfigPlugin(LimiterConfiguration::class.java
prefs.getLong(ACRA.PREF_LAST_VERSION_NR, 0)
} catch (e: ClassCastException) {
prefs.getInt(ACRA.PREF_LAST_VERSION_NR, 0).toLong()
} catch (e: Exception) {
0
}
val appVersion = getAppVersion(context)
if (appVersion > lastVersionNr) {
Expand All @@ -67,4 +69,4 @@ class LimiterStartupProcessor : HasConfigPlugin(LimiterConfiguration::class.java
* @return app version or 0 if PackageInfo was not available.
*/
private fun getAppVersion(context: Context): Long = PackageManagerWrapper(context).getPackageInfo()?.versionCodeLong ?: 0
}
}

0 comments on commit e809d37

Please sign in to comment.