19017N/A--- a/src/core/errors.c
19017N/A+++ b/src/core/errors.c
19017N/A@@ -222,10 +222,10 @@ x_error_handler (Display *xdisplay,
19017N/A
19017N/A display = meta_display_for_x_display (xdisplay);
19017N/A
19017N/A- /* Display can be NULL here because the compositing manager
19017N/A- * has its own Display, but Xlib only has one global error handler
19017N/A+ /* Display can be NULL here Xlib only has one global error handler; and
19017N/A+ * there might be other displays open in the process.
19017N/A */
19017N/A- if (display->error_traps > 0)
19017N/A+ if (display && display->error_traps > 0)
19017N/A {
19017N/A /* we're in an error trap, chain to the trap handler
19017N/A * saved from GDK
19017N/A@@ -264,21 +264,18 @@ x_io_error_handler (Display *xdisplay)
19017N/A
19017N/A display = meta_display_for_x_display (xdisplay);
19017N/A
19017N/A- if (display == NULL)
19017N/A- meta_bug ("IO error received for unknown display?\n");
19017N/A-
19017N/A if (errno == EPIPE)
19017N/A {
19017N/A meta_warning (_("Lost connection to the display '%s';\n"
19017N/A "most likely the X server was shut down or you killed/destroyed\n"
19017N/A "the window manager.\n"),
19017N/A- display->name);
19017N/A+ display ? display->name : DisplayString (xdisplay));
19017N/A }
19017N/A else
19017N/A {
19017N/A meta_warning (_("Fatal IO error %d (%s) on display '%s'.\n"),
19017N/A errno, g_strerror (errno),
19017N/A- display->name);
19017N/A+ display ? display->name : DisplayString (xdisplay));
19017N/A }
19017N/A
19017N/A /* Xlib would force an exit anyhow */
19017N/A--
19017N/A