Skip to content

Commit 7bf6bbf

Browse files
loongalldayChavin Panicharoen
andauthored
Fix Runtime warning on pushing multiple items into NavigationStackController (TCA only) (#248)
* fix, add if isEmpty condition on removing invalid indices * fix wrong isEmptyPosition --------- Co-authored-by: Chavin Panicharoen <[email protected]>
1 parent a488fef commit 7bf6bbf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Sources/UIKitNavigation/Navigation/NavigationStackController.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,9 @@
148148
invalidIndices.insert(index)
149149
}
150150
}
151-
path.remove(atOffsets: invalidIndices)
151+
if !invalidIndices.isEmpty {
152+
path.remove(atOffsets: invalidIndices)
153+
}
152154
setViewControllers(newViewControllers, animated: !transaction.uiKit.disablesAnimations)
153155
}
154156
}

0 commit comments

Comments
 (0)