From 257a71d29e476b58c2bfad99e23d533480ee8799 Mon Sep 17 00:00:00 2001 From: SaracenOne Date: Sun, 20 Feb 2022 17:22:14 +0000 Subject: [PATCH] Fix nullptr error in _update_padded_texture on texture with no image --- scene/resources/tile_set.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp index 1e84947b872..11741170281 100644 --- a/scene/resources/tile_set.cpp +++ b/scene/resources/tile_set.cpp @@ -4432,6 +4432,10 @@ void TileSetAtlasSource::_update_padded_texture() { Ref src = texture->get_image(); + if (!src.is_valid()) { + return; + } + Ref image; image.instantiate(); image->create(size.x, size.y, false, src->get_format());