From ce57b3cc4b37b3775b16da7ee007ffe88cb973e8 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 18 Jun 2023 09:54:53 +0200 Subject: [PATCH] lets simplify the null check --- .../com/simplemobiletools/keyboard/views/MyKeyboardView.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt b/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt index f65c227..8653f04 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt @@ -749,12 +749,12 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut } private fun clearClipboardContent() { - val clipboardManager = (context.getSystemService(Context.CLIPBOARD_SERVICE) as? ClipboardManager) + val clipboardManager = (context.getSystemService(Context.CLIPBOARD_SERVICE) as? ClipboardManager) ?: return if (isPiePlus()) { - clipboardManager?.clearPrimaryClip() + clipboardManager.clearPrimaryClip() } else { val clip = ClipData.newPlainText("", "") - clipboardManager?.setPrimaryClip(clip) + clipboardManager.setPrimaryClip(clip) } }