Skip to content

Commit

Permalink
🐞 fix: NPE crash problem (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
Leobuaa authored Feb 21, 2024
1 parent b2d3769 commit f2faa4e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Any, Any>())
Expand Down

0 comments on commit f2faa4e

Please sign in to comment.