Merge pull request #22737 from DualMatrix/warn_sort_custom
Added a check in sort_custom that test whether the given method exists.
This commit is contained in:
commit
fc6cf69a90
1 changed files with 1 additions and 0 deletions
|
@ -258,6 +258,7 @@ struct _ArrayVariantSortCustom {
|
||||||
Array &Array::sort_custom(Object *p_obj, const StringName &p_function) {
|
Array &Array::sort_custom(Object *p_obj, const StringName &p_function) {
|
||||||
|
|
||||||
ERR_FAIL_NULL_V(p_obj, *this);
|
ERR_FAIL_NULL_V(p_obj, *this);
|
||||||
|
ERR_FAIL_COND_V(!p_obj->has_method(p_function), *this);
|
||||||
|
|
||||||
SortArray<Variant, _ArrayVariantSortCustom, true> avs;
|
SortArray<Variant, _ArrayVariantSortCustom, true> avs;
|
||||||
avs.compare.obj = p_obj;
|
avs.compare.obj = p_obj;
|
||||||
|
|
Loading…
Reference in a new issue