Skip to content

Commit

Permalink
🐞 fix: NPE crash problem
Browse files Browse the repository at this point in the history
  • Loading branch information
Leobuaa committed Feb 18, 2024
1 parent b2d3769 commit b834201
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 b834201

Please sign in to comment.