Merge pull request #46166 from angad-k/fix-mesh-instance3d-crash

add null check in MeshInstance::_mesh_changed()
This commit is contained in:
Rémi Verschelde 2021-02-18 14:58:20 +01:00 committed by GitHub
commit ef63b29da7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -319,6 +319,7 @@ Ref<Material> MeshInstance3D::get_active_material(int p_surface) const {
}
void MeshInstance3D::_mesh_changed() {
ERR_FAIL_COND(mesh.is_null());
materials.resize(mesh->get_surface_count());
}