]> git.saurik.com Git - wxWidgets.git/commitdiff
Return NULL from wxAuiNotebook::GetCurrentPage() if there is no selection.
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 6 Feb 2012 13:28:42 +0000 (13:28 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 6 Feb 2012 13:28:42 +0000 (13:28 +0000)
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

src/aui/auibook.cpp

index beebabff8a74d5f4c13db82daddf23908f80fc6e..f299944023979d58ee11b40b54a7ada40cff303e 100644 (file)
@@ -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)