Skip to content

Commit

Permalink
Merge pull request godotengine#47375 from rishabhabhani/master
Browse files Browse the repository at this point in the history
Added null checks for mesh in resource importer
  • Loading branch information
akien-mga authored Mar 26, 2021
2 parents 6bb1eb8 + 435c804 commit 21f9cb2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions editor/import/resource_importer_scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 21f9cb2

Please sign in to comment.