git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34988
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
void wxGenericTreeCtrl::SetWindowStyle(const long styles)
{
void wxGenericTreeCtrl::SetWindowStyle(const long styles)
{
- if (!HasFlag(wxTR_HIDE_ROOT) && (styles & wxTR_HIDE_ROOT))
+ // Do not try to expand the root node if it hasn't been created yet
+ if (m_anchor && !HasFlag(wxTR_HIDE_ROOT) && (styles & wxTR_HIDE_ROOT))
{
// if we will hide the root, make sure children are visible
m_anchor->SetHasPlus();
{
// if we will hide the root, make sure children are visible
m_anchor->SetHasPlus();