From 0bd83b6635dab461afd62eb2c69d03e754c2ffaf Mon Sep 17 00:00:00 2001 From: daboe01 Date: Fri, 3 Apr 2026 15:20:59 +0200 Subject: [PATCH] new: clear CPPredicateEditor rows when objectValue is set to nil --- AppKit/CPRuleEditor/CPPredicateEditor.j | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/AppKit/CPRuleEditor/CPPredicateEditor.j b/AppKit/CPRuleEditor/CPPredicateEditor.j index 16cf1f685..5076b7ddc 100644 --- a/AppKit/CPRuleEditor/CPPredicateEditor.j +++ b/AppKit/CPRuleEditor/CPPredicateEditor.j @@ -269,6 +269,8 @@ _currentAnimation = nil; _sendAction = NO; + var rows = []; + if (predicate != nil) { if ((_nestingMode == CPRuleEditorNestingModeSimple || _nestingMode == CPRuleEditorNestingModeCompound) @@ -276,10 +278,13 @@ predicate = [[CPCompoundPredicate alloc] initWithType:[self _compoundPredicateTypeForRootRows] subpredicates:[CPArray arrayWithObject:predicate]]; var row = [self _rowObjectFromPredicate:predicate]; + if (row != nil) - [_boundArrayOwner setValue:[CPArray arrayWithObject:row] forKey:_boundArrayKeyPath]; + [rows addObject:row]; } + [_boundArrayOwner setValue:rows forKey:_boundArrayKeyPath]; + [self setAnimation:animation]; }