From bc564cd661c242d65bc2323fec8ca992cc5ef352 Mon Sep 17 00:00:00 2001 From: Maganty Rushyendra Date: Thu, 31 Dec 2020 18:33:39 +0800 Subject: [PATCH] Issue more precise error when disconnecting a nonexistent connection Checks whether the signal exists when issuing an error message when disconnecting a nonexistent connection. Also prints the callable name. (cherry picked from commit 6c026a6814eb15c2832f9cfd30ee8ef8d0a236ab) --- core/object.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/object.cpp b/core/object.cpp index 361e0ae85f4..38c5399be91 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -1563,7 +1563,13 @@ void Object::_disconnect(const StringName &p_signal, Object *p_to_object, const ERR_FAIL_NULL(p_to_object); Signal *s = signal_map.getptr(p_signal); - ERR_FAIL_COND_MSG(!s, vformat("Nonexistent signal '%s' in %s.", p_signal, to_string())); + if (!s) { + bool signal_is_valid = ClassDB::has_signal(get_class_name(), p_signal) || + (!script.is_null() && Ref