diff --git a/android/src/main/kotlin/clipboard/watcher/ClipboardWatcherPlugin.kt b/android/src/main/kotlin/clipboard/watcher/ClipboardWatcherPlugin.kt index c8d4937..b46d340 100644 --- a/android/src/main/kotlin/clipboard/watcher/ClipboardWatcherPlugin.kt +++ b/android/src/main/kotlin/clipboard/watcher/ClipboardWatcherPlugin.kt @@ -107,7 +107,7 @@ class ClipboardWatcherPlugin : FlutterPlugin, val clipboardManager = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager val clipData = clipboardManager.primaryClip if (clipData != null && clipData.itemCount > 0) { - val currentClipboardContent = clipData.getItemAt(0).text.toString() + val currentClipboardContent = clipData.getItemAt(0).text?.toString() if (currentClipboardContent != lastClipboardContent) { lastClipboardContent = currentClipboardContent channel.invokeMethod("onClipboardChanged", emptyMap())