Add null check for NavigationMesh.create_from_mesh()

This commit is contained in:
sps1112 2021-03-03 15:59:30 +05:30
parent 4d1f83a621
commit cf6bfea93f

View file

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