Add missing file existence check in `forms.drawIcon`

This commit is contained in:
YoshiRulz 2022-02-04 16:53:48 +10:00
parent 1dbc40e386
commit d3e439982b
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 5 additions and 0 deletions

View File

@ -677,6 +677,11 @@ namespace BizHawk.Client.EmuHawk
"draws an Icon (.ico) file from the given path at the given coordinate. width and height are optional. If specified, it will resize the image accordingly")]
public void DrawIcon(int componentHandle, string path, int x, int y, int? width = null, int? height = null)
{
if (!File.Exists(path))
{
LogOutputCallback($"File not found: {path}\nScript Terminated");
return;
}
try
{
var ptr = new IntPtr(componentHandle);