浏览代码

Add null check for NavigationMesh.create_from_mesh()

sps1112 4 年之前
父节点
当前提交
cf6bfea93f
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      scene/resources/navigation_mesh.cpp

+ 2 - 0
scene/resources/navigation_mesh.cpp

@@ -31,6 +31,8 @@
 #include "navigation_mesh.h"
 
 void NavigationMesh::create_from_mesh(const Ref<Mesh> &p_mesh) {
+	ERR_FAIL_COND(p_mesh.is_null());
+
 	vertices = Vector<Vector3>();
 	clear_polygons();