From 3f0248dc8edabe26bbee12f38331b9a888c80a1b Mon Sep 17 00:00:00 2001 From: kobewi Date: Tue, 4 Jan 2022 14:48:16 +0100 Subject: [PATCH] Fix method validation in Thread --- core/bind/core_bind.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index 0186798073b..bd9442e848b 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -2701,7 +2701,7 @@ void _Thread::_start_func(void *ud) { Error _Thread::start(Object *p_instance, const StringName &p_method, const Variant &p_userdata, Priority p_priority) { ERR_FAIL_COND_V_MSG(is_active(), ERR_ALREADY_IN_USE, "Thread already started."); ERR_FAIL_COND_V(!p_instance, ERR_INVALID_PARAMETER); - ERR_FAIL_COND_V(p_method == StringName(), ERR_INVALID_PARAMETER); + ERR_FAIL_COND_V(p_method == StringName() || !p_instance->has_method(p_method), ERR_INVALID_PARAMETER); ERR_FAIL_INDEX_V(p_priority, PRIORITY_MAX, ERR_INVALID_PARAMETER); ret = Variant();