]> git.saurik.com Git - wxWidgets.git/commitdiff
don't crash when showing vert toolbar when horz one is not shown
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 1 Aug 2005 01:07:28 +0000 (01:07 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 1 Aug 2005 01:07:28 +0000 (01:07 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35045 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/toolbar/toolbar.cpp

index a1155218972cab31582e0f54d136a8e1ef968964..5284572c397d5fa95a514e95438dfe820633e0f4 100644 (file)
@@ -587,7 +587,8 @@ void MyFrame::OnToggleAnotherToolbar(wxCommandEvent& WXUNUSED(event))
     }
     else
     {
     }
     else
     {
-        long style = GetToolBar()->GetWindowStyle();
+        long style = GetToolBar() ? GetToolBar()->GetWindowStyle()
+                                  : TOOLBAR_STYLE;
         style &= ~wxTB_HORIZONTAL;
         style |= wxTB_VERTICAL;
 
         style &= ~wxTB_HORIZONTAL;
         style |= wxTB_VERTICAL;