From 07ed869b94fa8acf18d64864c6d8662bfbec33dd Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 15 Feb 2022 20:07:54 +1100 Subject: RNA: add RNA_collection_is_empty & RNA_property_collection_is_empty Some collections needed to be iterated over to count their length. Provide a function to check if the collection is empty to avoid this. --- source/blender/editors/curve/editcurve_paint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/curve') diff --git a/source/blender/editors/curve/editcurve_paint.c b/source/blender/editors/curve/editcurve_paint.c index eee806898f6..0d6db8743af 100644 --- a/source/blender/editors/curve/editcurve_paint.c +++ b/source/blender/editors/curve/editcurve_paint.c @@ -577,7 +577,7 @@ static bool curve_draw_init(bContext *C, wmOperator *op, bool is_invoke) /* Using an empty stroke complicates logic later, * it's simplest to disallow early on (see: T94085). */ - if (RNA_collection_length(op->ptr, "stroke") == 0) { + if (RNA_collection_is_empty(op->ptr, "stroke")) { MEM_freeN(cdd); BKE_report(op->reports, RPT_ERROR, "The \"stroke\" cannot be empty"); return false; -- cgit v1.2.3