From 435c80490a8361168ce14bf0c37a8dec31706f89 Mon Sep 17 00:00:00 2001 From: Rishabh Abhani Date: Fri, 26 Mar 2021 11:49:06 +0530 Subject: [PATCH] added null checks for mesh in resource importer --- editor/import/resource_importer_scene.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index 3abdc5a3284..9041b815ca2 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, List> &r_shape_list, bool p_convex) { + ERR_FAIL_NULL_MSG(mesh, "Cannot generate shape list with null mesh value"); if (!p_convex) { Ref shape = mesh->create_trimesh_shape(); r_shape_list.push_back(shape); @@ -248,6 +249,7 @@ static void _gen_shape_list(const Ref &mesh, List> &r_shape_l } static void _pre_gen_shape_list(const Ref &mesh, List> &r_shape_list, bool p_convex) { + ERR_FAIL_NULL_MSG(mesh, "Cannot generate shape list with null mesh value"); if (!p_convex) { Ref shape = mesh->create_trimesh_shape(); r_shape_list.push_back(shape);