X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fd6939a6d2543534ba2616f20062590e439b50d4..96b2cbe8b39292fed91654ff0d1f4b1c16561acb:/src/msw/toolbar.cpp diff --git a/src/msw/toolbar.cpp b/src/msw/toolbar.cpp index 16bd76be16..e8c47e5ed3 100644 --- a/src/msw/toolbar.cpp +++ b/src/msw/toolbar.cpp @@ -581,13 +581,15 @@ bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *tool) wxToolBarTool *tool2 = (wxToolBarTool*)node->GetData(); if ( tool2->IsControl() ) { + wxControl * const control = tool2->GetControl(); + int x; - wxControl *control = tool2->GetControl(); control->GetPosition(&x, NULL); control->Move(x - width, wxDefaultCoord); - wxStaticText* staticText = tool2->GetStaticText(); - staticText->Move(x - width, wxDefaultCoord); + wxStaticText * const staticText = tool2->GetStaticText(); + if ( staticText ) + staticText->Move(x - width, wxDefaultCoord); } }