Merge pull request #47375 from rishabhabhani/master

Added null checks for mesh in resource importer
This commit is contained in:
Rémi Verschelde 2021-03-26 09:27:00 +01:00 committed by GitHub
commit 21f9cb29bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);