Browse Source

Merge pull request #62349 from KoBeWi/crash_pattern

Fix crash when drawing invalid tiles
Rémi Verschelde 3 years ago
parent
commit
6260ab6a4d
1 changed files with 3 additions and 0 deletions
  1. 3 0
      editor/plugins/tiles/tile_map_editor.cpp

+ 3 - 0
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());