File tree 1 file changed +12
-6
lines changed
1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -23610,12 +23610,18 @@ procedure TBaseVirtualTree.HandleMouseUp(var Message: TWMMouse; const HitInfo: T
23610
23610
if tsMouseCheckPending in FStates then
23611
23611
begin
23612
23612
DoStateChange([], [tsMouseCheckPending]);
23613
- // Is the mouse still over the same node?
23614
- if (HitInfo.HitNode = FCheckNode) and (hiOnItem in HitInfo.HitPositions) then
23615
- DoCheckClick(FCheckNode, FPendingCheckState)
23616
- else
23617
- FCheckNode.CheckState := UnpressedState[FCheckNode.CheckState];
23618
- InvalidateNode(FCheckNode);
23613
+ // Need check for nil, issue #285
23614
+ // because when mouse down on checkbox but not yet released
23615
+ // and in this time list starts to rebuild by timer
23616
+ // after this when mouse release FCheckNode equal nil
23617
+ if Assigned (FCheckNode) then begin
23618
+ // Is the mouse still over the same node?
23619
+ if (HitInfo.HitNode = FCheckNode) and (hiOnItem in HitInfo.HitPositions) then
23620
+ DoCheckClick(FCheckNode, FPendingCheckState)
23621
+ else
23622
+ FCheckNode.CheckState := UnpressedState[FCheckNode.CheckState];
23623
+ InvalidateNode(FCheckNode);
23624
+ end;
23619
23625
FCheckNode := nil;
23620
23626
end;
23621
23627
You can’t perform that action at this time.
0 commit comments