diff --git a/core/variant_call.cpp b/core/variant_call.cpp index b9547928915..12f36bab4e1 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -1438,12 +1438,11 @@ Variant::Type Variant::get_method_return_type(Variant::Type p_type, const String } Vector Variant::get_method_default_arguments(Variant::Type p_type, const StringName &p_method) { + ERR_FAIL_INDEX_V(p_type, Variant::VARIANT_MAX, Vector()); const _VariantCall::TypeFunc &tf = _VariantCall::type_funcs[p_type]; const Map::Element *E = tf.functions.find(p_method); - if (!E) { - return Vector(); - } + ERR_FAIL_COND_V(!E, Vector()); return E->get().default_args; }