X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9026d6fd7f505d01ec7e320276d41d42e01d7486..83c5e93495986edd1dbf8af1aa040666d0a635d1:/src/generic/dirdlgg.cpp diff --git a/src/generic/dirdlgg.cpp b/src/generic/dirdlgg.cpp index 0994cded6f..a07fbd497e 100644 --- a/src/generic/dirdlgg.cpp +++ b/src/generic/dirdlgg.cpp @@ -278,7 +278,13 @@ void wxGenericDirDialog::OnTreeSelected( wxTreeEvent &event ) if (!m_dirCtrl) return; - wxDirItemData *data = (wxDirItemData*)m_dirCtrl->GetTreeCtrl()->GetItemData(event.GetItem()); + wxTreeItemId item = event.GetItem(); + + wxDirItemData *data = NULL; + + if(item.IsOk()) + data = (wxDirItemData*)m_dirCtrl->GetTreeCtrl()->GetItemData(item); + if (data) m_input->SetValue( data->m_path ); };