diff options
author | Rafał Mikrut <mikrutrafal54@gmail.com> | 2019-10-28 08:07:29 +0100 |
---|---|---|
committer | Rafał Mikrut <mikrutrafal54@gmail.com> | 2019-10-28 08:07:29 +0100 |
commit | e53e1c566ac9e2e9b829f1cdbfd5d27537053cd1 (patch) | |
tree | 76cbb7b71e5da369511c6803926e33cbec858715 /scene/resources | |
parent | 4ecc30cc5ed04c770efd79c2c9f2b1dc9ae0af39 (diff) |
Fix some crashes and using null pointers
Diffstat (limited to 'scene/resources')
-rw-r--r-- | scene/resources/material.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index 0de462d616..3a15025ce2 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -1754,6 +1754,7 @@ SpatialMaterial::TextureChannel SpatialMaterial::get_roughness_texture_channel() void SpatialMaterial::set_ao_texture_channel(TextureChannel p_channel) { + ERR_FAIL_INDEX(p_channel, 5); ao_texture_channel = p_channel; VS::get_singleton()->material_set_param(_get_material(), shader_names->ao_texture_channel, _get_texture_mask(p_channel)); } @@ -1764,6 +1765,7 @@ SpatialMaterial::TextureChannel SpatialMaterial::get_ao_texture_channel() const void SpatialMaterial::set_refraction_texture_channel(TextureChannel p_channel) { + ERR_FAIL_INDEX(p_channel, 5); refraction_texture_channel = p_channel; VS::get_singleton()->material_set_param(_get_material(), shader_names->refraction_texture_channel, _get_texture_mask(p_channel)); } |