diff options
| author | Hein-Pieter van Braam <hp@tmm.cx> | 2019-02-27 01:47:55 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-02-27 01:47:55 +0100 |
| commit | 9434db47dc4e1dd417ca2d29bfe28f12ce960f3d (patch) | |
| tree | afcea9919530d7414f876734d1c33c29f24bf78f /editor | |
| parent | 270bbee018ff42f3e9fa400d960a6c63a4918f3a (diff) | |
| parent | 464e1142c48da5d24fb9d2462b707b695f9b5adc (diff) | |
Merge pull request #26331 from hpvb/fix-26284
Don't crash on previewing an AtlasTexture without a region
Diffstat (limited to 'editor')
| -rw-r--r-- | editor/plugins/editor_preview_plugins.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/editor/plugins/editor_preview_plugins.cpp b/editor/plugins/editor_preview_plugins.cpp index 3cf46e5b91..58d7968723 100644 --- a/editor/plugins/editor_preview_plugins.cpp +++ b/editor/plugins/editor_preview_plugins.cpp @@ -92,7 +92,12 @@ Ref<Texture> EditorTexturePreviewPlugin::generate(const RES &p_from, const Size2 if (!tex.is_valid()) { return Ref<Texture>(); } + Ref<Image> atlas = tex->get_data(); + if (!atlas.is_valid()) { + return Ref<Texture>(); + } + img = atlas->get_rect(atex->get_region()); } else if (ltex.is_valid()) { img = ltex->to_image(); |