summaryrefslogtreecommitdiff
path: root/scene/resources
diff options
context:
space:
mode:
authorSaracenOne <SaracenOne@gmail.com>2022-02-20 17:22:14 +0000
committerSaracenOne <SaracenOne@gmail.com>2022-02-20 17:22:14 +0000
commit257a71d29e476b58c2bfad99e23d533480ee8799 (patch)
tree8ed81644269a19eb4f1ad78d5cb9464271bfce90 /scene/resources
parent91a57b5b6a567ff10e30f4c0f1385c78e39ca284 (diff)
Fix nullptr error in _update_padded_texture on texture with no image
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/tile_set.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp
index 1e84947b87..1174117028 100644
--- a/scene/resources/tile_set.cpp
+++ b/scene/resources/tile_set.cpp
@@ -4432,6 +4432,10 @@ void TileSetAtlasSource::_update_padded_texture() {
Ref<Image> src = texture->get_image();
+ if (!src.is_valid()) {
+ return;
+ }
+
Ref<Image> image;
image.instantiate();
image->create(size.x, size.y, false, src->get_format());