]> git.saurik.com Git - wxWidgets.git/commitdiff
check for m_filectrl != NULL in OnUpdateButtonsUI() (fixes crash under GTK1)
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 4 Oct 2007 12:03:10 +0000 (12:03 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 4 Oct 2007 12:03:10 +0000 (12:03 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49038 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/filedlgg.cpp

index e0525766a13af49bbb2d590246bb57fff342a19a..bad3e2c6ec472a5b300e4ccaa1e9ebfe845000f1 100644 (file)
@@ -433,7 +433,10 @@ void wxGenericFileDialog::GetFilenames(wxArrayString& files) const
 
 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