CLI/testsuite: do not crash if a dialog is displayed.

pull/479/head
Ryan A. Pavlik 2019-09-09 22:23:31 -05:00 committed by whitequark
parent 22e4011cb6
commit 43b2261e9c
1 changed files with 11 additions and 1 deletions

View File

@ -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);