From 43b2261e9c35c07c33b02864d386152baa176c77 Mon Sep 17 00:00:00 2001 From: "Ryan A. Pavlik" Date: Mon, 9 Sep 2019 22:23:31 -0500 Subject: [PATCH] CLI/testsuite: do not crash if a dialog is displayed. --- src/util.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/util.cpp b/src/util.cpp index 36fd3ffe..26909054 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -143,7 +143,17 @@ static void MessageBox(const char *fmt, va_list va, bool error, description = description.substr(it - description.begin()); Platform::MessageDialogRef dialog = CreateMessageDialog(SS.GW.window); - + if (!dialog) { + if (error) { + fprintf(stderr, "Error: %s\n", message.c_str()); + } else { + fprintf(stderr, "Message: %s\n", message.c_str()); + } + if(onDismiss) { + onDismiss(); + } + return; + } using Platform::MessageDialog; if(error) { dialog->SetType(MessageDialog::Type::ERROR);