summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-03-26 09:27:00 +0100
committerGitHub <noreply@github.com>2021-03-26 09:27:00 +0100
commit21f9cb29bd49c82dbcea9eea55535455dfb24fa5 (patch)
tree1bfd12aa22713947ee647172193d4324823790b7
parent6bb1eb821286d23eaa518f7d12ad5a9d8aabdd7e (diff)
parent435c80490a8361168ce14bf0c37a8dec31706f89 (diff)
Merge pull request #47375 from rishabhabhani/master
Added null checks for mesh in resource importer
-rw-r--r--editor/import/resource_importer_scene.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp
index 3abdc5a328..9041b815ca 100644
--- a/editor/import/resource_importer_scene.cpp
+++ b/editor/import/resource_importer_scene.cpp
@@ -234,6 +234,7 @@ static String _fixstr(const String &p_what, const String &p_str) {
}
static void _gen_shape_list(const Ref<Mesh> &mesh, List<Ref<Shape3D>> &r_shape_list, bool p_convex) {
+ ERR_FAIL_NULL_MSG(mesh, "Cannot generate shape list with null mesh value");
if (!p_convex) {
Ref<Shape3D> shape = mesh->create_trimesh_shape();
r_shape_list.push_back(shape);
@@ -248,6 +249,7 @@ static void _gen_shape_list(const Ref<Mesh> &mesh, List<Ref<Shape3D>> &r_shape_l
}
static void _pre_gen_shape_list(const Ref<EditorSceneImporterMesh> &mesh, List<Ref<Shape3D>> &r_shape_list, bool p_convex) {
+ ERR_FAIL_NULL_MSG(mesh, "Cannot generate shape list with null mesh value");
if (!p_convex) {
Ref<Shape3D> shape = mesh->create_trimesh_shape();
r_shape_list.push_back(shape);