From: Vadim Zeitlin Date: Fri, 30 Mar 2007 15:57:43 +0000 (+0000) Subject: added wxCHECK to ensure that we don't dereference a NULL pointer X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/fe03e62800b03e60af4abf21a665cdf487755a47 added wxCHECK to ensure that we don't dereference a NULL pointer git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45153 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/motif/spinbutt.cpp b/src/motif/spinbutt.cpp index dd10927d96..a84d1f38dd 100644 --- a/src/motif/spinbutt.cpp +++ b/src/motif/spinbutt.cpp @@ -189,6 +189,8 @@ bool wxArrowButton::Create( wxSpinButton* parent, ArrowDirection d, const wxPoint& pos, const wxSize& size ) { + wxCHECK_MSG( parent, false, _T("must have a valid parent") ); + int arrow_dir = XmARROW_UP; switch( d ) @@ -207,7 +209,7 @@ bool wxArrowButton::Create( wxSpinButton* parent, break; } - if( parent ) parent->AddChild( this ); + parent->AddChild( this ); Widget parentWidget = (Widget) parent->GetClientWidget(); m_mainWidget = (WXWidget) XtVaCreateManagedWidget( "XmArrowButton",