From e53e1c566ac9e2e9b829f1cdbfd5d27537053cd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mikrut?= Date: Mon, 28 Oct 2019 08:07:29 +0100 Subject: Fix some crashes and using null pointers --- scene/resources/material.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scene/resources') 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)); } -- cgit v1.2.3