diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2018-10-05 09:15:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-05 09:15:05 +0200 |
commit | fc6cf69a900aa9ce7d29e94fa2cba1ff5c1b659f (patch) | |
tree | 5e93ef0adf4a85bada8aa3ef12b78acac90c5773 | |
parent | 0173cf640253af2f1a5c2dd583952e83c2a60ced (diff) | |
parent | 6415454581c3ba0025da6b9bae42e060fa4e1508 (diff) | |
download | redot-engine-fc6cf69a900aa9ce7d29e94fa2cba1ff5c1b659f.tar.gz |
Merge pull request #22737 from DualMatrix/warn_sort_custom
Added a check in sort_custom that test whether 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; |