diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-02-16 19:29:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-16 19:29:28 +0100 |
commit | ee501453179e5b3bdff10fd0ce39bf6c8f9bb06c (patch) | |
tree | 5bd49b2c8b215180f602c423d2ff71b3d6c488ae | |
parent | cb64f2d96ba25f516ecd6dfb3e80b7ddbb13971f (diff) | |
parent | f455f873c7902bd7378c6320ee39a0bad323186c (diff) |
Merge pull request #46097 from AndyBarcia/FixCrash
Fixes crash when using VisualShader::set_mode with invalid mode
-rw-r--r-- | scene/resources/visual_shader.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp index 438e130cf4..a296156bf5 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<Connection> *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; } |