Don't segfault on errors during construction of ConsolePanel

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1645 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2011-01-28 14:12:26 +00:00
parent 3946210d21
commit e6dc141339
+4
View File
@@ -295,6 +295,8 @@ ConsolePanel::ConsolePanel(Window* parent, int id)
, is_active_window(false)
, blinker_state(0)
, blinker_timer(this)
, messages(nullptr)
, entry(nullptr)
{
// init controls
splitter = new wxSplitterWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
@@ -363,6 +365,8 @@ void ConsolePanel::onIdle(wxIdleEvent&) {
}
void ConsolePanel::get_pending_errors() {
// The panel might not be initialized yet, in particular, construction of controls might fail, which results in a popup dialog with an event loop
if (!messages) return;
// add pending messages
MessageType type;
String msg;