Do not throw if the named image can not be found

This commit is contained in:
Samuel Attard 2017-10-10 03:18:44 +11:00
parent ec610cd97b
commit 767a178bd1
2 changed files with 0 additions and 2 deletions

View file

@ -544,7 +544,6 @@ mate::Handle<NativeImage> NativeImage::CreateFromDataURL(
#if !defined(OS_MACOSX)
mate::Handle<NativeImage> NativeImage::CreateFromNamedImage(
mate::Arguments* args, const std::string& name) {
args->ThrowError("Cannot create NativeImage from a name on non-darwin platforms");
return CreateEmpty(args->isolate());
}
#endif

View file

@ -17,7 +17,6 @@ mate::Handle<NativeImage> NativeImage::CreateFromNamedImage(
@autoreleasepool {
NSImage* image = [NSImage imageNamed:base::SysUTF8ToNSString(name)];
if (!image.valid) {
args->ThrowError("Cannot create image from name: " + name);
return CreateEmpty(args->isolate());
}