From 276141eec3fd9724497db9192300d0f84ac4f810 Mon Sep 17 00:00:00 2001 From: John Estropia Date: Sat, 30 Apr 2022 22:32:01 +0900 Subject: [PATCH] Clean out NSNulls in removedSubnodes list (fixes #2059) --- Source/Private/ASLayoutTransition.mm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/Private/ASLayoutTransition.mm b/Source/Private/ASLayoutTransition.mm index 588b27565..137836e1d 100644 --- a/Source/Private/ASLayoutTransition.mm +++ b/Source/Private/ASLayoutTransition.mm @@ -184,7 +184,11 @@ - (void)calculateSubnodeOperationsIfNeeded moves:&moves]; _insertedSubnodePositions = findNodesInLayoutAtIndexes(pendingLayout, insertions, &_insertedSubnodes); - _removedSubnodes = [previousNodes objectsAtIndexes:deletions]; + + NSMutableArray *mutableRemovedNodes = [[previousNodes objectsAtIndexes:deletions] mutableCopy]; + [mutableRemovedNodes removeObjectIdenticalTo:[NSNull null]]; + _removedSubnodes = [mutableRemovedNodes copy]; + // These should arrive sorted in ascending order of move destinations. for (NSIndexPath *move in moves) { _subnodeMoves.emplace_back(previousLayout.sublayouts[([move indexAtPosition:0])].layoutElement,