From: Vadim Zeitlin Date: Mon, 1 Aug 2005 01:07:28 +0000 (+0000) Subject: don't crash when showing vert toolbar when horz one is not shown X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/8927d6d11c67c84ff51b499d99c6f7a9670d3b78 don't crash when showing vert toolbar when horz one is not shown git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35045 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/toolbar/toolbar.cpp b/samples/toolbar/toolbar.cpp index a115521897..5284572c39 100644 --- a/samples/toolbar/toolbar.cpp +++ b/samples/toolbar/toolbar.cpp @@ -587,7 +587,8 @@ void MyFrame::OnToggleAnotherToolbar(wxCommandEvent& WXUNUSED(event)) } else { - long style = GetToolBar()->GetWindowStyle(); + long style = GetToolBar() ? GetToolBar()->GetWindowStyle() + : TOOLBAR_STYLE; style &= ~wxTB_HORIZONTAL; style |= wxTB_VERTICAL;