mirror of
https://github.com/godotengine/godot.git
synced 2025-04-13 01:00:35 +08:00
Validate argument in Navigation2D::navpoly_add
This commit is contained in:
parent
a2dd77867e
commit
050edac8e0
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user