Skip to content

Commit d315f71

Browse files
joshuafeldmanrandarnold
authored andcommitted
Issue lxcid#77 - Fixing a crash when previousIndexPath is nil
1 parent 58b772e commit d315f71

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

LXReorderableCollectionViewFlowLayout/LXReorderableCollectionViewFlowLayout.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ - (void)invalidateLayoutIfNecessary {
173173
NSIndexPath *newIndexPath = [self.collectionView indexPathForItemAtPoint:self.currentView.center];
174174
NSIndexPath *previousIndexPath = self.selectedItemIndexPath;
175175

176-
if ((newIndexPath == nil) || [newIndexPath isEqual:previousIndexPath]) {
176+
if ((newIndexPath == nil) || (previousIndexPath == nil) || [newIndexPath isEqual:previousIndexPath]) {
177177
return;
178178
}
179179

0 commit comments

Comments
 (0)