summaryrefslogtreecommitdiff
path: root/core/array.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/array.cpp')
-rw-r--r--core/array.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/array.cpp b/core/array.cpp
index 9708452850..9f09ddbe15 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<Variant, _ArrayVariantSortCustom, true> avs;
avs.compare.obj = p_obj;