diff options
author | Hein-Pieter van Braam <hp@tmm.cx> | 2018-03-02 09:37:32 +0100 |
---|---|---|
committer | Hein-Pieter van Braam <hp@tmm.cx> | 2018-03-02 09:37:32 +0100 |
commit | 555eebf3f4845c8138c24ded96fcb3fa5c67787a (patch) | |
tree | 8abf3e9bd73605eebec1fc6a119b97721fdbb699 /scene | |
parent | 08cadc3d871f681ef1f951894345359a85ba190e (diff) |
Don't crash when trying to add an invalid navmesh
It is possible to try to add an invalid object as a navmesh through
GDScript which results in an engine crash. This creates a debug message
that should help the user figure out what's wrong.
Diffstat (limited to 'scene')
-rw-r--r-- | scene/3d/navigation.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/scene/3d/navigation.cpp b/scene/3d/navigation.cpp index e7ab6cde8a..77bf703706 100644 --- a/scene/3d/navigation.cpp +++ b/scene/3d/navigation.cpp @@ -35,6 +35,7 @@ void Navigation::_navmesh_link(int p_id) { ERR_FAIL_COND(!navmesh_map.has(p_id)); NavMesh &nm = navmesh_map[p_id]; ERR_FAIL_COND(nm.linked); + ERR_FAIL_COND(nm.navmesh.is_null()); PoolVector<Vector3> vertices = nm.navmesh->get_vertices(); int len = vertices.size(); |