diff options
author | Hein-Pieter van Braam-Stewart <hp@tmm.cx> | 2019-04-19 22:03:00 +0200 |
---|---|---|
committer | Hein-Pieter van Braam-Stewart <hp@tmm.cx> | 2019-04-20 02:13:28 +0200 |
commit | 20b0046945bfe55591c370e32f4928f7cbeb45e6 (patch) | |
tree | c2c758a63639b868c9b2f66d375a47fb51aedbfb /core/object.cpp | |
parent | 8e652a1400ee20b99cf4829e8b4883fe3f254d59 (diff) | |
download | redot-engine-20b0046945bfe55591c370e32f4928f7cbeb45e6.tar.gz |
Object::script may not be a valid Ref<Script>
It appears that Object::script may be a valid ScriptInstance but not be
castable to Ref<Script>. There were only 5 places in the code that made
this assumption. This commit fixes that.
Diffstat (limited to 'core/object.cpp')
-rw-r--r-- | core/object.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/object.cpp b/core/object.cpp index 03a11b8ca3..039f556c87 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -1366,7 +1366,10 @@ Array Object::_get_incoming_connections() const { void Object::get_signal_list(List<MethodInfo> *p_signals) const { if (!script.is_null()) { - Ref<Script>(script)->get_script_signal_list(p_signals); + Ref<Script> scr = script; + if (scr.is_valid()) { + scr->get_script_signal_list(p_signals); + } } ClassDB::get_signal_list(get_class_name(), p_signals); |