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