X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0d1dd76baa52344e23ee9fb2c249c5633b30ed38..8a28cd66a63ce30c75173e10948e9d49d366d218:/src/aui/tabmdi.cpp diff --git a/src/aui/tabmdi.cpp b/src/aui/tabmdi.cpp index 13dc090b01..edf19a97be 100644 --- a/src/aui/tabmdi.cpp +++ b/src/aui/tabmdi.cpp @@ -244,14 +244,18 @@ bool wxAuiMDIParentFrame::ProcessEvent(wxEvent& event) wxAuiMDIChildFrame *wxAuiMDIParentFrame::GetActiveChild() const { - return GetClientWindow()->GetActiveChild(); + // We can be called before the client window is created, so check for its + // existence. + wxAuiMDIClientWindow* const client = GetClientWindow(); + return client ? client->GetActiveChild() : NULL; } void wxAuiMDIParentFrame::SetActiveChild(wxAuiMDIChildFrame* pChildFrame) { - if (GetClientWindow()->GetActiveChild() != pChildFrame) + wxAuiMDIClientWindow* const client = GetClientWindow(); + if (client && client->GetActiveChild() != pChildFrame) { - GetClientWindow()->SetActiveChild(pChildFrame); + client->SetActiveChild(pChildFrame); } }