Skip to content

Commit

Permalink
Merge pull request #77440 from KoBeWi/set_pattern_which_doesn't_exist
Browse files Browse the repository at this point in the history
Check for null in `set_pattern()`
  • Loading branch information
akien-mga committed May 24, 2023
2 parents 95bea89 + 9128ce9 commit 4c677c8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scene/2d/tile_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2334,7 +2334,8 @@ Vector2i TileMap::map_pattern(const Vector2i &p_position_in_tilemap, const Vecto

void TileMap::set_pattern(int p_layer, const Vector2i &p_position, const Ref<TileMapPattern> p_pattern) {
ERR_FAIL_INDEX(p_layer, (int)layers.size());
ERR_FAIL_COND(!tile_set.is_valid());
ERR_FAIL_COND(tile_set.is_null());
ERR_FAIL_COND(p_pattern.is_null());

TypedArray<Vector2i> used_cells = p_pattern->get_used_cells();
for (int i = 0; i < used_cells.size(); i++) {
Expand Down

0 comments on commit 4c677c8

Please sign in to comment.