ImageLoaderSVG: Improve error reporting
This commit is contained in:
@@ -84,7 +84,8 @@ static Ref<ImageTexture> generate_icon(int p_index) {
|
||||
// with integer scales.
|
||||
const bool upsample = !Math::is_equal_approx(Math::round(scale), scale);
|
||||
ImageLoaderSVG img_loader;
|
||||
img_loader.create_image_from_string(img, default_theme_icons_sources[p_index], scale, upsample, HashMap<Color, Color>());
|
||||
Error err = img_loader.create_image_from_string(img, default_theme_icons_sources[p_index], scale, upsample, HashMap<Color, Color>());
|
||||
ERR_FAIL_COND_V_MSG(err != OK, Ref<ImageTexture>(), "Failed generating icon, unsupported or invalid SVG data in default theme.");
|
||||
#endif
|
||||
|
||||
return ImageTexture::create_from_image(img);
|
||||
|
||||
Reference in New Issue
Block a user