mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 21:27:01 -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 {
|
Image BuiltInImage::generate(const Options& opt) const {
|
||||||
// TODO : use opt.width and opt.height?
|
// TODO : use opt.width and opt.height?
|
||||||
Image img = load_resource_image(name);
|
try {
|
||||||
if (!img.Ok()) {
|
Image img = load_resource_image(name);
|
||||||
throw ScriptError(_("There is no built in image '") + name + _("'"));
|
if (img.Ok()) return img;
|
||||||
}
|
} catch (...) {}
|
||||||
return img;
|
throw ScriptError(_("There is no built in image '") + name + _("'"));
|
||||||
}
|
}
|
||||||
bool BuiltInImage::operator == (const GeneratedImage& that) const {
|
bool BuiltInImage::operator == (const GeneratedImage& that) const {
|
||||||
const BuiltInImage* that2 = dynamic_cast<const BuiltInImage*>(&that);
|
const BuiltInImage* that2 = dynamic_cast<const BuiltInImage*>(&that);
|
||||||
|
|||||||
Reference in New Issue
Block a user