You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-28 16:07:14 +00:00
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:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user