Prevent crash if "registration-interval" is given a non-int value
This commit is contained in:
@ -1539,7 +1539,11 @@ private fun initAccountFromConfig(acc: Account, onConfigLoaded: () -> Unit) {
|
||||
acc.outbound.add(text)
|
||||
|
||||
"registration-interval" ->
|
||||
acc.configuredRegInt = text.toInt()
|
||||
acc.configuredRegInt = try {
|
||||
text.toInt()
|
||||
} catch (_: NumberFormatException) {
|
||||
900
|
||||
}
|
||||
|
||||
"register" ->
|
||||
acc.regint = if (text == "yes") acc.configuredRegInt else 0
|
||||
|
||||
Reference in New Issue
Block a user