summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-06-23 22:47:21 +0200
committerGitHub <noreply@github.com>2022-06-23 22:47:21 +0200
commit6260ab6a4de576b1ee05ee00fb0dae033e79266f (patch)
tree27386da9c343d5b212e4f83f40aa8ba78e69b18d /editor
parentb66080d43e7a16dab690db0da095044c86f70db4 (diff)
parent2ccef6616e202af6127c458b0c5ac3f1b7921597 (diff)
Merge pull request #62349 from KoBeWi/crash_pattern
Fix crash when drawing invalid tiles
Diffstat (limited to 'editor')
-rw-r--r--editor/plugins/tiles/tile_map_editor.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/editor/plugins/tiles/tile_map_editor.cpp b/editor/plugins/tiles/tile_map_editor.cpp
index 77a3c07548..d914b9c363 100644
--- a/editor/plugins/tiles/tile_map_editor.cpp
+++ b/editor/plugins/tiles/tile_map_editor.cpp
@@ -884,6 +884,9 @@ void TileMapEditorTilesPlugin::forward_canvas_draw_over_viewport(Control *p_over
if (atlas_source) {
// Get tile data.
TileData *tile_data = atlas_source->get_tile_data(E.value.get_atlas_coords(), E.value.alternative_tile);
+ if (!tile_data) {
+ continue;
+ }
// Compute the offset
Rect2i source_rect = atlas_source->get_tile_texture_region(E.value.get_atlas_coords());