[PATCH] winex11.drv: Do not call old_error_handler if it is NULL.

Giovanni Mascellani gmascellani at codeweavers.com
Fri Feb 12 05:58:00 CST 2021


Signed-off-by: Giovanni Mascellani <gmascellani at codeweavers.com>
---
 dlls/winex11.drv/x11drv_main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c
index 9ec4c7a98f6..58fab96c034 100644
--- a/dlls/winex11.drv/x11drv_main.c
+++ b/dlls/winex11.drv/x11drv_main.c
@@ -304,7 +304,10 @@ static int error_handler( Display *display, XErrorEvent *error_evt )
              error_evt->serial, error_evt->request_code );
         DebugBreak();  /* force an entry in the debugger */
     }
-    old_error_handler( display, error_evt );
+    /* Xlib never returns a NULL previous error handler, but other
+       implementations, like Steam's overlay, do. */
+    if (old_error_handler)
+        old_error_handler( display, error_evt );
     return 0;
 }
 
-- 
2.30.0




More information about the wine-devel mailing list