mac: Check for invalid image

This commit is contained in:
Cheng Zhao 2015-01-02 18:35:33 -08:00
parent ac8a9afada
commit 3d7da455bc

View file

@ -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;
}