mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-08 20:58:28 +02:00
LCL/ShellCtrls: Fix ShellTreeView crashing when a file has been deleted by the OS.
This commit is contained in:
parent
de03939782
commit
e9e8f6ef32
@ -82,6 +82,11 @@ var
|
|||||||
begin
|
begin
|
||||||
fileName := WideString(ATreeView.GetPathFromNode(ANode));
|
fileName := WideString(ATreeView.GetPathFromNode(ANode));
|
||||||
ico := GetShellIcon(fileName);
|
ico := GetShellIcon(fileName);
|
||||||
|
if ico = nil then
|
||||||
|
begin
|
||||||
|
Result := Types.Size(0, 0);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
try
|
try
|
||||||
ATreeView.Canvas.Draw(ARect.Left, (ARect.Top + ARect.Bottom - ico.Height) div 2, ico);
|
ATreeView.Canvas.Draw(ARect.Left, (ARect.Top + ARect.Bottom - ico.Height) div 2, ico);
|
||||||
Result := Types.Size(ico.Width, ico.Height);
|
Result := Types.Size(ico.Width, ico.Height);
|
||||||
|
Loading…
Reference in New Issue
Block a user