X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4f5c180eba88f20438789e1a84a435ed8615fbff..1ae2e0af5aaefe5a9409964daed3c5ca70ee24a0:/src/generic/dirctrlg.cpp diff --git a/src/generic/dirctrlg.cpp b/src/generic/dirctrlg.cpp index 891d11d7aa..b42f9d6d9e 100644 --- a/src/generic/dirctrlg.cpp +++ b/src/generic/dirctrlg.cpp @@ -614,7 +614,9 @@ void wxGenericDirCtrl::OnExpandItem(wxTreeEvent &event) // VS: this is needed because the event handler is called from wxTreeCtrl // ctor when wxTR_HIDE_ROOT was specified - if (m_rootId == 0) + + if (!m_rootId.IsOk()) + m_rootId = m_treeCtrl->GetRootItem(); ExpandDir(parentId);