mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Don't throw internal errors when built_in_image script function fails to find an image
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user