Check for null in set_pattern()

This commit is contained in:
kobewi 2023-05-24 16:39:48 +02:00
parent b7032b5ecf
commit 9128ce95ce

View File

@ -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++) {