summaryrefslogtreecommitdiff
path: root/modules/visual_script/visual_script_nodes.cpp
diff options
context:
space:
mode:
authorYuri Roubinsky <chaosus89@gmail.com>2021-07-19 11:22:28 +0300
committerGitHub <noreply@github.com>2021-07-19 11:22:28 +0300
commite1547798d661e972e06860a33b92f7cbd6ec69d0 (patch)
tree932edaaad81f59162b7d21952247add5430b1d0a /modules/visual_script/visual_script_nodes.cpp
parent95def293a6f72c97a473a6db0eb9e279e5c934a8 (diff)
parent88088f351ab093f489d4320cf8f3376de9481e59 (diff)
Merge pull request #50413 from Chaosus/vs_cleanup_warnings
Diffstat (limited to 'modules/visual_script/visual_script_nodes.cpp')
-rw-r--r--modules/visual_script/visual_script_nodes.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/visual_script/visual_script_nodes.cpp b/modules/visual_script/visual_script_nodes.cpp
index b93c710652..41b51c6e65 100644
--- a/modules/visual_script/visual_script_nodes.cpp
+++ b/modules/visual_script/visual_script_nodes.cpp
@@ -191,7 +191,10 @@ PropertyInfo VisualScriptFunction::get_input_value_port_info(int p_idx) const {
}
PropertyInfo VisualScriptFunction::get_output_value_port_info(int p_idx) const {
- ERR_FAIL_INDEX_V(p_idx, arguments.size(), PropertyInfo());
+ // Need to check it without ERR_FAIL_COND, to prevent warnings from appearing on node creation via dragging.
+ if (p_idx < 0 || p_idx >= arguments.size()) {
+ return PropertyInfo();
+ }
PropertyInfo out;
out.type = arguments[p_idx].type;
out.name = arguments[p_idx].name;