git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49038
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
void wxGenericFileDialog::OnUpdateButtonsUI(wxUpdateUIEvent& event)
{
- event.Enable( !IsTopMostDir(m_filectrl->GetDirectory()) );
+ // surprisingly, we can be called before m_filectrl is set in Create() as
+ // wxFileCtrl ctor itself can generate idle events, so we need this test
+ if ( m_filectrl )
+ event.Enable( !IsTopMostDir(m_filectrl->GetDirectory()) );
}
#ifdef wxHAS_GENERIC_FILEDIALOG