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
This commit is contained in:
Robin Dunn
2002-10-17 18:23:50 +00:00
parent 7c603b9907
commit 049d5d2cca

View File

@@ -809,7 +809,7 @@ void wxSplitterWindow::SizeWindows()
// Set pane for unsplit window // Set pane for unsplit window
void wxSplitterWindow::Initialize(wxWindow *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!") ); _T("windows in the splitter should have it as parent!") );
m_windowOne = window; m_windowOne = window;
@@ -827,7 +827,10 @@ bool wxSplitterWindow::DoSplit(wxSplitMode mode,
if ( IsSplit() ) if ( IsSplit() )
return FALSE; 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!") ); _T("windows in the splitter should have it as parent!") );
m_splitMode = mode; m_splitMode = mode;