diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-10-28 08:37:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-28 08:37:59 +0100 |
commit | 63c5cd7eb89c5e7d24465b910eb6015b344c3f5f (patch) | |
tree | 0da485fc1328f59d10b8c0a04074db3e729c2fa5 /scene/resources | |
parent | 826ffc26c985db7cbaaa3fef4c60af8fef514f0c (diff) | |
parent | e53e1c566ac9e2e9b829f1cdbfd5d27537053cd1 (diff) |
Merge pull request #33104 from qarmin/fix_some_crashes
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 10bea5f64c..b10db9ee61 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -1776,6 +1776,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)); } @@ -1786,6 +1787,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)); } |