]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/dirctrlg.cpp
prevent memory leak
[wxWidgets.git] / src / generic / dirctrlg.cpp
index 27ae4e40b1c61f99cb77b31e0ed814316474e524..b0f677fdff1f9c1599d2910844fda6f5eecb1710 100644 (file)
@@ -668,7 +668,8 @@ void wxGenericDirCtrl::SetFocus()
 {
     // we don't need focus ourselves, give it to the tree so that the user
     // could navigate it
-    m_treeCtrl->SetFocus();
+    if (m_treeCtrl)
+        m_treeCtrl->SetFocus();
 }
 
 void wxGenericDirCtrl::OnBeginEditItem(wxTreeEvent &event)