diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-11-23 17:22:16 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-11-23 17:22:16 +0100 |
commit | cfb5ce771ce6ac681c86a3a510c92d5a59ca155c (patch) | |
tree | d138f5e118287603a5c0c5b0c641c82f6fa10518 /scene | |
parent | 1b3b208e0077f219d30a82ecc938e1fb42cdfce0 (diff) | |
parent | d3b8faac746b9ecffbec1f905c9eceef27c27ad7 (diff) |
Merge pull request #69048 from akien-mga/thorvg-better-errors
ImageLoaderSVG: Improve error reporting
Diffstat (limited to 'scene')
-rw-r--r-- | scene/resources/default_theme/default_theme.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index 894936acd7..f179b4b818 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -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); |