updated for version 7.0c10
diff --git a/src/if_xcmdsrv.c b/src/if_xcmdsrv.c
index d19f50d..ef6e257 100644
--- a/src/if_xcmdsrv.c
+++ b/src/if_xcmdsrv.c
@@ -1111,14 +1111,23 @@
     int		result, actualFormat;
     long_u	bytesAfter;
     Atom	actualType;
+    XErrorHandler old_handler;
 
     *regPropp = NULL;
+    old_handler = XSetErrorHandler(x_error_check);
+    got_x_error = FALSE;
+
     result = XGetWindowProperty(dpy, RootWindow(dpy, 0), registryProperty, 0L,
 				(long)MAX_PROP_WORDS, False,
 				XA_STRING, &actualType,
 				&actualFormat, numItemsp, &bytesAfter,
 				regPropp);
 
+    XSync(dpy, FALSE);
+    (void)XSetErrorHandler(old_handler);
+    if (got_x_error)
+	return FAIL;
+
     if (actualType == None)
     {
 	/* No prop yet. Logically equal to the empty list */