diff --git a/scene/resources/navigation_mesh.cpp b/scene/resources/navigation_mesh.cpp index eea4227d55f..f304c11ebb8 100644 --- a/scene/resources/navigation_mesh.cpp +++ b/scene/resources/navigation_mesh.cpp @@ -381,6 +381,10 @@ Ref NavigationMesh::get_debug_mesh() { debug_mesh = Ref(memnew(ArrayMesh)); + if (lines.empty()) { + return debug_mesh; + } + Array arr; arr.resize(Mesh::ARRAY_MAX); arr[Mesh::ARRAY_VERTEX] = varr;