Merge pull request #802 from RobinD42/fix-tabmdi-close
Ensure the selection is in range.
This commit is contained in:
@@ -820,7 +820,7 @@ int wxAuiMDIClientWindow::SetSelection(size_t nPage)
|
||||
wxAuiMDIChildFrame* wxAuiMDIClientWindow::GetActiveChild()
|
||||
{
|
||||
const int sel = GetSelection();
|
||||
if ( sel == wxNOT_FOUND )
|
||||
if ( sel == wxNOT_FOUND || sel >= GetPageCount() )
|
||||
return NULL;
|
||||
|
||||
return wxStaticCast(GetPage(sel), wxAuiMDIChildFrame);
|
||||
|
Reference in New Issue
Block a user