mirror of
https://github.com/android-password-store/Android-Password-Store
synced 2025-08-31 22:35:17 +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 -> {
|
ACTION_START -> {
|
||||||
val time = try {
|
val time = settings.getString(PreferenceKeys.GENERAL_SHOW_TIME)?.toIntOrNull() ?: 45
|
||||||
Integer.parseInt(settings.getString(PreferenceKeys.GENERAL_SHOW_TIME)
|
|
||||||
?: "45")
|
|
||||||
} catch (e: NumberFormatException) {
|
|
||||||
45
|
|
||||||
}
|
|
||||||
|
|
||||||
if (time == 0) {
|
if (time == 0) {
|
||||||
stopSelf()
|
stopSelf()
|
||||||
|
Reference in New Issue
Block a user