Skip to content

Commit ce57b3c

Browse files
committed
lets simplify the null check
1 parent d2c3116 commit ce57b3c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -749,12 +749,12 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
749749
}
750750

751751
private fun clearClipboardContent() {
752-
val clipboardManager = (context.getSystemService(Context.CLIPBOARD_SERVICE) as? ClipboardManager)
752+
val clipboardManager = (context.getSystemService(Context.CLIPBOARD_SERVICE) as? ClipboardManager) ?: return
753753
if (isPiePlus()) {
754-
clipboardManager?.clearPrimaryClip()
754+
clipboardManager.clearPrimaryClip()
755755
} else {
756756
val clip = ClipData.newPlainText("", "")
757-
clipboardManager?.setPrimaryClip(clip)
757+
clipboardManager.setPrimaryClip(clip)
758758
}
759759
}
760760

0 commit comments

Comments
 (0)