Selaa lähdekoodia

Merge pull request #46617 from sps1112/fix-navigationmesh-crash

Add null check in NavigationMesh.new().create_from_mesh(BoxShape.new())
Rémi Verschelde 4 vuotta sitten
vanhempi
commit
864caf5711
1 muutettua tiedostoa jossa 2 lisäystä ja 0 poistoa
  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();