IDE/Options: Handle exception when saving project icon to file. Issue #36828

(cherry picked from commit 024055f99b)
This commit is contained in:
n7800 2025-07-12 02:58:57 +05:00 committed by wp_xyz
parent 448628e758
commit 1d56e79ea9

View File

@ -10,6 +10,7 @@ uses
FileUtil,
// LCL
LCLType, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls, Buttons, ComCtrls, ExtDlgs,
LCLStrConsts,
// LazControls
DividerBevel,
// IdeIntf
@ -194,8 +195,16 @@ end;
procedure TProjectApplicationOptionsFrame.SaveIconButtonClick(Sender: TObject);
begin
if (IconImage.Picture.Graphic = nil) or IconImage.Picture.Graphic.Empty then
exit;
if SavePictureDialog1.Execute then
IconImage.Picture.SaveToFile(SavePictureDialog1.FileName);
try
IconImage.Picture.SaveToFile(SavePictureDialog1.FileName);
except
on E: Exception do
IDEMessageDialog(rsMtError, E.Message, mtError, [mbCancel]);
end;
end;
procedure TProjectApplicationOptionsFrame.UseAppBundleCheckBoxChange(