mac: Check for invalid image
This commit is contained in:
parent
ac8a9afada
commit
3d7da455bc
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue