API/ABI change: XCBSendRequest returns the sequence number instead of using an out...
[free-sw/xcb/libxcb] / src / xcb_in.c
index cf7dbe7..973a0d2 100644 (file)
@@ -238,6 +238,10 @@ void *XCBWaitForReply(XCBConnection *c, unsigned int request, XCBGenericError **
     if(e)
         *e = 0;
 
+    /* If an error occurred when issuing the request, fail immediately. */
+    if(!request)
+        return 0;
+
     pthread_mutex_lock(&c->iolock);
 
     /* If this request has not been written yet, write it. */