diff options
author | Franklin Sobrinho <franklin_gs@hotmail.com> | 2015-12-12 14:06:27 -0300 |
---|---|---|
committer | Franklin Sobrinho <franklin_gs@hotmail.com> | 2015-12-12 14:06:27 -0300 |
commit | 3dead22454f40cbf34ae7015143936acb359580b (patch) | |
tree | 08da5f37853ab952101954e9765ccb6b35c2a92c | |
parent | 990690f9f53ec3f042d6df174fff05f2de25ca3d (diff) |
Fix crash caused by a empty NavigationMesh
-rw-r--r-- | tools/editor/spatial_editor_gizmos.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/editor/spatial_editor_gizmos.cpp b/tools/editor/spatial_editor_gizmos.cpp index 5efca44c7d..04a6b1b437 100644 --- a/tools/editor/spatial_editor_gizmos.cpp +++ b/tools/editor/spatial_editor_gizmos.cpp @@ -2283,6 +2283,8 @@ void NavigationMeshSpatialGizmo::redraw() { } } + if (faces.empty()) + return; Map<_EdgeKey,bool> edge_map; DVector<Vector3> tmeshfaces; @@ -2330,7 +2332,7 @@ void NavigationMeshSpatialGizmo::redraw() { } } - Ref<TriangleMesh> tmesh = memnew( TriangleMesh); + Ref<TriangleMesh> tmesh = memnew( TriangleMesh ); tmesh->create(tmeshfaces); if (lines.size()) |