Skip to content

Commit d2c3116

Browse files
committed
adding a null check
1 parent febd621 commit d2c3116

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ android {
6565
}
6666

6767
dependencies {
68-
implementation 'com.github.SimpleMobileTools:Simple-Commons:d5a26c4d27'
68+
implementation 'com.github.SimpleMobileTools:Simple-Commons:d1ed742806'
6969
implementation 'androidx.emoji2:emoji2-bundled:1.2.0'
7070

7171
kapt 'androidx.room:room-compiler:2.5.1'

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)
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)