From 7a7777cb4a6935980c6e76b577e728b1e7a796b6 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sat, 13 Oct 2018 11:27:27 +0200 Subject: [PATCH] Fix wxPGProperty::GetMainParent() function Traversing upwards in the tree should be stopped when parent is root or category property. --- src/propgrid/property.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/propgrid/property.cpp b/src/propgrid/property.cpp index 5cfa571546..a09beb72e1 100644 --- a/src/propgrid/property.cpp +++ b/src/propgrid/property.cpp @@ -2254,7 +2254,7 @@ wxPGProperty* wxPGProperty::GetMainParent() const const wxPGProperty* curChild = this; const wxPGProperty* curParent = m_parent; - while ( curParent && !curParent->IsCategory() ) + while ( !curParent->IsRoot() && !curParent->IsCategory() ) { curChild = curParent; curParent = curParent->m_parent;