X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/77dd7daad2df0faac2b4e846ac9bb6aff588278c..91ad3a26e39458e6fcd593165ad0a7aaccbe86a1:/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); } }