diff --git a/tools/editor/spatial_editor_gizmos.cpp b/tools/editor/spatial_editor_gizmos.cpp index 5efca44c7db..04a6b1b437b 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 tmeshfaces; @@ -2330,7 +2332,7 @@ void NavigationMeshSpatialGizmo::redraw() { } } - Ref tmesh = memnew( TriangleMesh); + Ref tmesh = memnew( TriangleMesh ); tmesh->create(tmeshfaces); if (lines.size())