diff options
author | kobewi <kobewi4e@gmail.com> | 2022-06-23 14:34:23 +0200 |
---|---|---|
committer | kobewi <kobewi4e@gmail.com> | 2022-06-23 14:34:23 +0200 |
commit | 2ccef6616e202af6127c458b0c5ac3f1b7921597 (patch) | |
tree | 6fe18c389bc6dbf6e3afcb274a4b1765b984b3a4 /editor | |
parent | 91b984a507a7dc6da017220bb02b4e7fe1abc4be (diff) |
Fix crash when drawing invalid tiles
Diffstat (limited to 'editor')
-rw-r--r-- | editor/plugins/tiles/tile_map_editor.cpp | 3 |
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()); |