LCL/ShellCtrls: Fix ShellTreeView crashing when a file has been deleted by the OS.

This commit is contained in:
wp_xyz 2022-07-27 12:49:06 +02:00
parent de03939782
commit e9e8f6ef32

View File

@ -82,6 +82,11 @@ var
begin
fileName := WideString(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);