Merge pull request #46097 from AndyBarcia/FixCrash

Fixes crash when using VisualShader::set_mode with invalid mode
This commit is contained in:
Rémi Verschelde authored and GitHub committed 2021-02-16 19:29:28 +01:00
commit ee50145317
1 file changed
+2
+2
View File
@@ -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;
}