Fix crash when restoring old backups

This commit is contained in:
Bnyro 2023-03-28 18:31:14 +02:00
parent f9a25738cd
commit a1618a6556

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 {