Commit 59c6ab4c authored by twanvl's avatar twanvl

Don't segfault on errors during construction of ConsolePanel

parent ed1f4830
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment