From 276087e92dd707d990565a373ab9f51a3a52ef2d Mon Sep 17 00:00:00 2001 From: Andreas Haas Date: Sun, 25 Sep 2016 19:21:21 +0200 Subject: [PATCH] Throw error when trying to emit a non-existing signal. closes #6017 --- core/object.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/object.cpp b/core/object.cpp index 8cd4e070977..9a1e9be8d5f 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -1215,6 +1215,15 @@ void Object::emit_signal(const StringName& p_name,const Variant** p_args,int p_a Signal *s = signal_map.getptr(p_name); if (!s) { +#ifdef DEBUG_ENABLED + bool signal_is_valid = ObjectTypeDB::has_signal(get_type_name(),p_name); + //check in script + if (!signal_is_valid && !script.is_null() && !Ref