Commit d0ae63ea authored by Daniel Wolf's avatar Daniel Wolf
Browse files

Use 1 as unit if none (or invalid) is given

parent d58a1e6b
......@@ -67,7 +67,7 @@ class HostSourceRefreshDialog(context:Context,
dialog.dismiss()
context.getPreferences().automaticHostRefresh = view.automaticRefresh.isChecked
context.getPreferences().automaticHostRefreshWifiOnly = view.refreshWifiOnly.isChecked
context.getPreferences().automaticHostRefreshTimeAmount = view.timeAmount.text.toString().toInt()
context.getPreferences().automaticHostRefreshTimeAmount = view.timeAmount.text.toString().toIntOrNull() ?: 1
context.getPreferences().automaticHostRefreshTimeUnit = TimeUnit.values().find { it.ordinal == view.timeUnit.selectedItemPosition }!!
refreshConfigChanged()
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment