mirror of
https://github.com/android-password-store/Android-Password-Store
synced 2025-08-30 22:05:19 +00:00
ClipboardService: use runCatching to replace exception handling
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
@@ -45,12 +45,7 @@ class ClipboardService : Service() {
|
||||
}
|
||||
|
||||
ACTION_START -> {
|
||||
val time = try {
|
||||
Integer.parseInt(settings.getString(PreferenceKeys.GENERAL_SHOW_TIME)
|
||||
?: "45")
|
||||
} catch (e: NumberFormatException) {
|
||||
45
|
||||
}
|
||||
val time = settings.getString(PreferenceKeys.GENERAL_SHOW_TIME)?.toIntOrNull() ?: 45
|
||||
|
||||
if (time == 0) {
|
||||
stopSelf()
|
||||
|
Reference in New Issue
Block a user