From f14e80077c5640d2a3e2e9898dda37ef44ffeb38 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Sat, 3 Aug 2019 23:20:42 +0200 Subject: Clipboard.c: do not send notify when pointer is NULL There was only one place where this was checked but we check it always. --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent/Clipboard.c') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index fe5c7d2c9..c3314d6dd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -714,6 +714,14 @@ FIXME: Do we need this? void nxagentSendSelectionNotify(Atom property) { + if (lastClientClientPtr == NULL) + { + #ifdef DEBUG + fprintf(stderr, "%s: lastClientClientPtr is NULL - doing nothing.\n", __func__); + #endif + return; + } + xEvent x; #ifdef DEBUG @@ -920,10 +928,7 @@ void nxagentCollectPropertyEvent(int resource) fprintf (stderr, "%s: WARNING! Invalid property value.\n", __func__); #endif - if (lastClientClientPtr != NULL) - { - nxagentSendSelectionNotify(None); - } + nxagentSendSelectionNotify(None); lastClientWindowPtr = NULL; SetClientSelectionStage(None); -- cgit v1.2.3