diff options
author | DualMatrix <piet.goris@gmail.com> | 2018-10-04 23:38:31 +0200 |
---|---|---|
committer | DualMatrix <piet.goris@gmail.com> | 2018-10-04 23:38:31 +0200 |
commit | 6415454581c3ba0025da6b9bae42e060fa4e1508 (patch) | |
tree | 4894c4c4f5ca0171d4ad6d799341cdf1c79c0764 | |
parent | 0f4c30fb7166e84d93f0b2cb20d726f869155d98 (diff) |
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.
-rw-r--r-- | core/array.cpp | 1 |
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; |