mirror of
https://github.com/electron/electron.git
synced 2026-01-25 15:28:11 -05:00
mac: Check for invalid image
This commit is contained in:
@@ -38,6 +38,9 @@ bool Converter<gfx::Image>::FromV8(v8::Isolate* isolate,
|
||||
|
||||
base::scoped_nsobject<NSImage> image([[NSImage alloc]
|
||||
initByReferencingFile:base::SysUTF8ToNSString(path)]);
|
||||
if (![image isValid])
|
||||
return false;
|
||||
|
||||
*out = gfx::Image(image.release());
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user