Don't throw internal errors when built_in_image script function fails to find an image

This commit is contained in:
Twan van Laarhoven
2020-04-23 23:00:38 +02:00
parent 4258ce1c6c
commit 815df01ba5
+5 -5
View File
@@ -435,11 +435,11 @@ bool PackagedImage::operator == (const GeneratedImage& that) const {
Image BuiltInImage::generate(const Options& opt) const {
// TODO : use opt.width and opt.height?
Image img = load_resource_image(name);
if (!img.Ok()) {
throw ScriptError(_("There is no built in image '") + name + _("'"));
}
return img;
try {
Image img = load_resource_image(name);
if (img.Ok()) return img;
} catch (...) {}
throw ScriptError(_("There is no built in image '") + name + _("'"));
}
bool BuiltInImage::operator == (const GeneratedImage& that) const {
const BuiltInImage* that2 = dynamic_cast<const BuiltInImage*>(&that);