Skip to content

Commit

Permalink
Validate argument in Navigation2D::navpoly_add
Browse files Browse the repository at this point in the history
  • Loading branch information
qarmin authored and lekoder committed Apr 24, 2021
1 parent e6af6fb commit 6d552c8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scene/2d/navigation_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ void Navigation2D::_navpoly_unlink(int p_id) {

int Navigation2D::navpoly_add(const Ref<NavigationPolygon> &p_mesh, const Transform2D &p_xform, Object *p_owner) {

ERR_FAIL_COND_V(p_mesh.is_null(), -1);

int id = last_id++;
NavMesh nm;
nm.linked = false;
Expand Down

0 comments on commit 6d552c8

Please sign in to comment.