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.
This commit is contained in:
DualMatrix 2018-10-04 23:38:31 +02:00
parent 0f4c30fb71
commit 6415454581

View file

@ -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;