From f1feaaf4e07e4018c86150141fbed667ff04a49c Mon Sep 17 00:00:00 2001 From: Bart <9132501-flyingsheep@users.noreply.gitlab.com> Date: Sat, 7 Dec 2024 18:45:20 +0100 Subject: [PATCH] TListView: fix potential AV in SetDropTarget. Issue #19083. (cherry picked from commit 4204fa7a65f3ba7997b516af1aaea4941005b17c) --- lcl/include/customlistview.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lcl/include/customlistview.inc b/lcl/include/customlistview.inc index e952b47d8e..b2cf34e7d3 100644 --- a/lcl/include/customlistview.inc +++ b/lcl/include/customlistview.inc @@ -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);