From: Vadim Zeitlin Date: Mon, 6 Feb 2012 13:28:42 +0000 (+0000) Subject: Return NULL from wxAuiNotebook::GetCurrentPage() if there is no selection. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/b98eb28a50fcb379b1eb52f365cea430cd7a956e Return NULL from wxAuiNotebook::GetCurrentPage() if there is no selection. Make it behave as wxBookCtrlBase::GetCurrentPage() and just silently return NULL instead of asserting if there is no selection. Closes #13932. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70525 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index beebabff8a..f299944023 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -4500,7 +4500,9 @@ bool wxAuiNotebook::SetPageImage(size_t n, int imageId) wxWindow* wxAuiNotebook::GetCurrentPage () const { - return GetPage(GetSelection()); + const int sel = GetSelection(); + + return sel == wxNOT_FOUND ? NULL : GetPage(sel); } int wxAuiNotebook::ChangeSelection(size_t n)