Skip to content

Commit

Permalink
Push clipboard text only if not null
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rom1v committed May 27, 2020
1 parent 2ca8318 commit 93a5c51
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/src/main/java/com/genymobile/scrcpy/Controller.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 93a5c51

Please sign in to comment.