From 050edac8e0375b24e73ff7ea96af98cc5011ea60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mikrut?= Date: Wed, 31 Mar 2021 20:10:51 +0200 Subject: [PATCH] Validate argument in Navigation2D::navpoly_add --- scene/2d/navigation_2d.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scene/2d/navigation_2d.cpp b/scene/2d/navigation_2d.cpp index a6c5fe000b2..dcd9faa7914 100644 --- a/scene/2d/navigation_2d.cpp +++ b/scene/2d/navigation_2d.cpp @@ -204,6 +204,8 @@ void Navigation2D::_navpoly_unlink(int p_id) { int Navigation2D::navpoly_add(const Ref &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;