]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix for [ 688754 ] wxNotebook::SetSelection(-1) will segfault
authorJulian Smart <julian@anthemion.co.uk>
Sun, 1 Jun 2003 19:41:50 +0000 (19:41 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Sun, 1 Jun 2003 19:41:50 +0000 (19:41 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20836 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/notebook.cpp
src/gtk1/notebook.cpp

index 113739fb5104a6453df28d1eb1b0954830c71b0c..a904117fafdaa86163c93026d6394db2ecdd105a 100644 (file)
@@ -373,7 +373,7 @@ int wxNotebook::SetSelection( int page )
 {
     wxCHECK_MSG( m_widget != NULL, -1, wxT("invalid notebook") );
 
-    wxCHECK_MSG( page < (int)m_pagesData.GetCount(), -1, wxT("invalid notebook index") );
+    wxCHECK_MSG( page >= 0 && page < (int)m_pagesData.GetCount(), -1, wxT("invalid notebook index") );
 
     int selOld = GetSelection();
 
index 113739fb5104a6453df28d1eb1b0954830c71b0c..a904117fafdaa86163c93026d6394db2ecdd105a 100644 (file)
@@ -373,7 +373,7 @@ int wxNotebook::SetSelection( int page )
 {
     wxCHECK_MSG( m_widget != NULL, -1, wxT("invalid notebook") );
 
-    wxCHECK_MSG( page < (int)m_pagesData.GetCount(), -1, wxT("invalid notebook index") );
+    wxCHECK_MSG( page >= 0 && page < (int)m_pagesData.GetCount(), -1, wxT("invalid notebook index") );
 
     int selOld = GetSelection();