mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-07 18:40:41 +02:00
IDE: ignore exceptions for invalid project icons
This commit is contained in:
parent
77aecca951
commit
3c917017f5
@ -124,10 +124,12 @@ begin
|
||||
xIcon := TIcon.Create;
|
||||
try
|
||||
xIcon.LoadFromFile(xIconFile);
|
||||
Result := Images.AddIcon(xIcon);
|
||||
finally
|
||||
xIcon.Free;
|
||||
except
|
||||
FreeAndNil(xIcon); // ignore exceptions for invalid icons
|
||||
end;
|
||||
if Assigned(xIcon) then
|
||||
Result := Images.AddIcon(xIcon);
|
||||
xIcon.Free;
|
||||
end;
|
||||
|
||||
xObj := TLoadProjectIconIntoImagesObject.Create;
|
||||
|
@ -1700,11 +1700,14 @@ begin
|
||||
begin
|
||||
IconStream := LazProject.ProjResources.ProjectIcon.GetStream;
|
||||
if IconStream<>nil then
|
||||
begin
|
||||
try
|
||||
Icon.LoadFromStream(IconStream);
|
||||
finally
|
||||
IconStream.Free;
|
||||
except
|
||||
Icon.Clear; // ignore exceptions for invalid icons
|
||||
end;
|
||||
IconStream.Free;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user