From 6415454581c3ba0025da6b9bae42e060fa4e1508 Mon Sep 17 00:00:00 2001 From: DualMatrix Date: Thu, 4 Oct 2018 23:38:31 +0200 Subject: [PATCH] Added a check in sort_custom thats test wether the given method exists. Added a check in sort_custom thats test wether the given method exists. --- core/array.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/core/array.cpp b/core/array.cpp index 97084528506..9f09ddbe158 100644 --- a/core/array.cpp +++ b/core/array.cpp @@ -258,6 +258,7 @@ struct _ArrayVariantSortCustom { Array &Array::sort_custom(Object *p_obj, const StringName &p_function) { ERR_FAIL_NULL_V(p_obj, *this); + ERR_FAIL_COND_V(!p_obj->has_method(p_function), *this); SortArray avs; avs.compare.obj = p_obj;