TListView: fix potential AV in SetDropTarget. Issue #19083.

(cherry picked from commit 4204fa7a65)
This commit is contained in:
Bart 2024-12-07 18:45:20 +01:00 committed by Martin
parent 796a8090d4
commit f1feaaf4e0

View File

@ -1629,7 +1629,8 @@ end;
procedure TCustomListView.SetDropTarget(const AValue: TListItem);
begin
if not HandleAllocated then Exit;
TWSCustomListViewClass(WidgetSetClass).ItemSetState(Self, AValue.Index, AValue, lisDropTarget, True);
if AValue <> nil then
TWSCustomListViewClass(WidgetSetClass).ItemSetState(Self, AValue.Index, AValue, lisDropTarget, True);
end;
procedure TCustomListView.SetFocused(const AValue: TListItem);