fix SP crash on start

This commit is contained in:
Milos Kozak 2021-09-13 19:28:45 +02:00
parent efd6b28a64
commit 0b764a2881

View file

@ -90,7 +90,11 @@ class SPImplementation @Inject constructor(
return try {
sharedPreferences.getLong(key, defaultValue)
} catch (e: Exception) {
SafeParse.stringToLong(sharedPreferences.getString(key, defaultValue.toString()))
try {
SafeParse.stringToLong(sharedPreferences.getString(key, defaultValue.toString()))
} catch (e: Exception) {
defaultValue
}
}
}