mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-13 14:39:09 +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;
|
xIcon := TIcon.Create;
|
||||||
try
|
try
|
||||||
xIcon.LoadFromFile(xIconFile);
|
xIcon.LoadFromFile(xIconFile);
|
||||||
Result := Images.AddIcon(xIcon);
|
except
|
||||||
finally
|
FreeAndNil(xIcon); // ignore exceptions for invalid icons
|
||||||
xIcon.Free;
|
|
||||||
end;
|
end;
|
||||||
|
if Assigned(xIcon) then
|
||||||
|
Result := Images.AddIcon(xIcon);
|
||||||
|
xIcon.Free;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
xObj := TLoadProjectIconIntoImagesObject.Create;
|
xObj := TLoadProjectIconIntoImagesObject.Create;
|
||||||
|
@ -1700,9 +1700,12 @@ begin
|
|||||||
begin
|
begin
|
||||||
IconStream := LazProject.ProjResources.ProjectIcon.GetStream;
|
IconStream := LazProject.ProjResources.ProjectIcon.GetStream;
|
||||||
if IconStream<>nil then
|
if IconStream<>nil then
|
||||||
|
begin
|
||||||
try
|
try
|
||||||
Icon.LoadFromStream(IconStream);
|
Icon.LoadFromStream(IconStream);
|
||||||
finally
|
except
|
||||||
|
Icon.Clear; // ignore exceptions for invalid icons
|
||||||
|
end;
|
||||||
IconStream.Free;
|
IconStream.Free;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user