From 89765faf3da5d11d2113bdf25ef13f936d118589 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sat, 13 Oct 2012 07:01:05 +0200 Subject: [PATCH] Fix segfault on faulty command-line option --- dialogs.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dialogs.c b/dialogs.c index a720a9f..a826a37 100644 --- a/dialogs.c +++ b/dialogs.c @@ -1825,10 +1825,12 @@ DisplayFatalError (String message, int error, int status) snprintf(buf, sizeof(buf), "%s: %s", message, strerror(error)); message = buf; } - if (appData.popupExitMessage && boardWidget && XtIsRealized(boardWidget)) { - ErrorPopUp(status ? _("Fatal Error") : _("Exiting"), message, TRUE); - } else { - ExitEvent(status); + if(mainOptions[W_BOARD].handle) { + if (appData.popupExitMessage) { + ErrorPopUp(status ? _("Fatal Error") : _("Exiting"), message, TRUE); + } else { + ExitEvent(status); + } } } -- 1.7.0.4