From a79e6e46dad6be977072a8bdae679696a95d1fe0 Mon Sep 17 00:00:00 2001 From: James Turner Date: Sun, 1 Aug 2021 17:09:20 +0100 Subject: [PATCH] GUI: don't warn on empty dialogs --- src/GUI/new_gui.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/GUI/new_gui.cxx b/src/GUI/new_gui.cxx index 219c2bd21..c54e7b2ac 100644 --- a/src/GUI/new_gui.cxx +++ b/src/GUI/new_gui.cxx @@ -201,6 +201,11 @@ NewGUI::update (double delta_time_sec) bool NewGUI::showDialog (const string &name) { + if (name.empty()) { + SG_LOG(SG_GENERAL, SG_ALERT, "showDialog: no dialog name provided"); + return false; + } + // first, check if it's already shown if (_active_dialogs.find(name) != _active_dialogs.end()){ _active_dialogs[name]->bringToFront();