From b341e513514d50cc995a5646a1bbace65dc4ca67 Mon Sep 17 00:00:00 2001
From: Alex Pilon <alp@alexpilon.ca>
Date: Mon, 16 Mar 2015 11:51:23 -0400
Subject: Handle pasting of empty selection.

Otherwise, pasting the X11 primary selection when empty results an
error and Xlib forcibly exits.

Signed-off-by: Christoph Lohmann <20h@r-36.net>
---
 st.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/st.c b/st.c
index aa4185c..836ae21 100644
--- a/st.c
+++ b/st.c
@@ -995,6 +995,8 @@ selnotify(XEvent *e) {
 
 	ofs = 0;
 	xsev = (XSelectionEvent *)e;
+	if (xsev->property == None)
+	    return;
 	do {
 		if(XGetWindowProperty(xw.dpy, xw.win, xsev->property, ofs,
 					BUFSIZ/4, False, AnyPropertyType,
-- 
cgit v1.2.3