Skip to content

Commit 3ce43de

Browse files
authored
fix: Prevent app crash while moving presets (LoopKit#540)
1 parent 873b3b7 commit 3ce43de

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

LoopKitUI/View Controllers/OverrideSelectionViewController.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,8 @@ public final class OverrideSelectionViewController: UICollectionViewController,
388388
return originalIndexPath
389389
}
390390

391-
return proposedIndexPath == indexPathOfCustomOverride()
391+
let customPresetRow = self.collectionView(collectionView, numberOfItemsInSection: proposedIndexPath.section) - 2
392+
return proposedIndexPath.row >= customPresetRow
392393
? originalIndexPath
393394
: proposedIndexPath
394395

0 commit comments

Comments
 (0)