From 049d5d2cca6cddfd2913e68698d0cf0b5076bd43 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 17 Oct 2002 18:23:50 +0000 Subject: [PATCH] Fix a couple asserts so they won't deref NULL pointers if that's what was passed in. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17552 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/splitter.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/generic/splitter.cpp b/src/generic/splitter.cpp index 703459522e..695bd426f2 100644 --- a/src/generic/splitter.cpp +++ b/src/generic/splitter.cpp @@ -809,7 +809,7 @@ void wxSplitterWindow::SizeWindows() // Set pane for unsplit window void wxSplitterWindow::Initialize(wxWindow *window) { - wxASSERT_MSG( window->GetParent() == this, + wxASSERT_MSG( window && window->GetParent() == this, _T("windows in the splitter should have it as parent!") ); m_windowOne = window; @@ -827,7 +827,10 @@ bool wxSplitterWindow::DoSplit(wxSplitMode mode, if ( IsSplit() ) return FALSE; - wxASSERT_MSG( window1->GetParent() == this && window2->GetParent() == this, + wxCHECK_MSG( window1 && window2, FALSE, + _T("can not split with NULL window(s)") ); + + wxCHECK_MSG( window1->GetParent() == this && window2->GetParent() == this, FALSE, _T("windows in the splitter should have it as parent!") ); m_splitMode = mode;