From: Vadim Zeitlin Date: Fri, 24 Oct 2003 20:08:12 +0000 (+0000) Subject: fixed crash on startup under GTK X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/e4a8a172020d5e3ee08660420142e702799c7878 fixed crash on startup under GTK git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24285 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/treectrl/treetest.cpp b/samples/treectrl/treetest.cpp index 60f030ae13..270161f9ca 100644 --- a/samples/treectrl/treetest.cpp +++ b/samples/treectrl/treetest.cpp @@ -329,15 +329,18 @@ void MyFrame::TogStyle(int id, long flag) void MyFrame::OnIdle(wxIdleEvent& event) { #if wxUSE_STATUSBAR - wxTreeItemId idRoot = m_treeCtrl->GetRootItem(); - - SetStatusText(wxString::Format - ( - _T("Root/last item is %svisible/%svisible"), - m_treeCtrl->IsVisible(idRoot) ? _T("") : _T("not "), - m_treeCtrl->IsVisible(m_treeCtrl->GetLastChild(idRoot)) - ? _T("") : _T("not ") - ), 1); + if ( m_treeCtrl ) + { + wxTreeItemId idRoot = m_treeCtrl->GetRootItem(); + + SetStatusText(wxString::Format + ( + _T("Root/last item is %svisible/%svisible"), + m_treeCtrl->IsVisible(idRoot) ? _T("") : _T("not "), + m_treeCtrl->IsVisible(m_treeCtrl->GetLastChild(idRoot)) + ? _T("") : _T("not ") + ), 1); + } #endif // wxUSE_STATUSBAR event.Skip();