From f455f873c7902bd7378c6320ee39a0bad323186c Mon Sep 17 00:00:00 2001 From: andybarcia Date: Tue, 16 Feb 2021 14:46:20 +0100 Subject: [PATCH] Fixes crash when calling VisualShader::set_mode --- scene/resources/visual_shader.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp index 438e130cf42..a296156bf5d 100644 --- a/scene/resources/visual_shader.cpp +++ b/scene/resources/visual_shader.cpp @@ -675,6 +675,8 @@ void VisualShader::get_node_connections(Type p_type, List *r_connect } void VisualShader::set_mode(Mode p_mode) { + ERR_FAIL_INDEX_MSG(p_mode, Mode::MODE_MAX, vformat("Invalid shader mode: %d.", p_mode)); + if (shader_mode == p_mode) { return; }