Skip to content

Commit

Permalink
Merge pull request #3436 from Bnyro/master
Browse files Browse the repository at this point in the history
Fix crash when restoring old backups
  • Loading branch information
Bnyro authored Mar 28, 2023
2 parents 81bbbda + a1618a6 commit 796d3b4
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 796d3b4

Please sign in to comment.