File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -17202,7 +17202,7 @@ procedure TBaseVirtualTree.EndUpdate;
17202
17202
if tsChangePending in FStates then
17203
17203
DoChange(FLastChangedNode);
17204
17204
finally
17205
- if toAutoSort in FOptions.AutoOptions then
17205
+ if ( toAutoSort in FOptions.AutoOptions) then
17206
17206
SortTree(FHeader.SortColumn, FHeader.SortDirection, True);
17207
17207
17208
17208
SetUpdateState(False);
@@ -22535,6 +22535,9 @@ procedure TBaseVirtualTree.SortTree(Column: TColumnIndex; Direction: TSortDirect
22535
22535
if RootNode.TotalCount <= 2 then
22536
22536
Exit;//Nothing to do if there are one or zero nodes. RootNode.TotalCount is 1 if there are no nodes in the treee as the root node counts too here.
22537
22537
22538
+ if not Assigned(FRoot.FirstChild) then
22539
+ Exit; // Sorting should not initialize the root nodes
22540
+
22538
22541
// Instead of wrapping the sort using BeginUpdate/EndUpdate simply the update counter
22539
22542
// is modified. Otherwise the EndUpdate call will recurse here.
22540
22543
System.Inc(FUpdateCount);
You can’t perform that action at this time.
0 commit comments