From 93a5c5149d6b4d04376f147e6da2f5ca3ced8aea Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Wed, 27 May 2020 18:12:35 +0200 Subject: [PATCH] Push clipboard text only if not null In practice, it does not change anything (it just avoids a spurious wake-up), but semantically, it makes no sense to call pushClipboardText() with a null value. --- server/src/main/java/com/genymobile/scrcpy/Controller.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/com/genymobile/scrcpy/Controller.java b/server/src/main/java/com/genymobile/scrcpy/Controller.java index 4999f7eb67..960c6a6e59 100644 --- a/server/src/main/java/com/genymobile/scrcpy/Controller.java +++ b/server/src/main/java/com/genymobile/scrcpy/Controller.java @@ -105,7 +105,9 @@ private void handleEvent() throws IOException { break; case ControlMessage.TYPE_GET_CLIPBOARD: String clipboardText = device.getClipboardText(); - sender.pushClipboardText(clipboardText); + if (clipboardText != null) { + sender.pushClipboardText(clipboardText); + } break; case ControlMessage.TYPE_SET_CLIPBOARD: boolean paste = (msg.getFlags() & ControlMessage.FLAGS_PASTE) != 0;