Merge pull request #3436 from Bnyro/master

Fix crash when restoring old backups
This commit is contained in:
Bnyro 2023-03-28 18:31:32 +02:00 committed by GitHub
commit 796d3b4990
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,7 +64,9 @@ object PreferenceHelper {
}
fun getInt(key: String?, defValue: Int): Int {
return settings.getInt(key, defValue)
return runCatching {
settings.getInt(key, defValue)
}.getOrElse { settings.getLong(key, defValue.toLong()).toInt() }
}
fun getLong(key: String?, defValue: Long): Long {