From bb0b14332288b2a0164c9b2a0a1a5819be75d5f2 Mon Sep 17 00:00:00 2001 From: louistran99 Date: Tue, 23 Sep 2014 10:00:29 -0700 Subject: [PATCH] Fixed intermittent crash when long press one cell & drag and tap/hold another cell --- .../LXReorderableCollectionViewFlowLayout.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LXReorderableCollectionViewFlowLayout/LXReorderableCollectionViewFlowLayout.m b/LXReorderableCollectionViewFlowLayout/LXReorderableCollectionViewFlowLayout.m index a34964b..c1219b5 100755 --- a/LXReorderableCollectionViewFlowLayout/LXReorderableCollectionViewFlowLayout.m +++ b/LXReorderableCollectionViewFlowLayout/LXReorderableCollectionViewFlowLayout.m @@ -149,7 +149,7 @@ - (void)invalidateLayoutIfNecessary { NSIndexPath *newIndexPath = [self.collectionView indexPathForItemAtPoint:self.currentView.center]; NSIndexPath *previousIndexPath = self.selectedItemIndexPath; - if ((newIndexPath == nil) || [newIndexPath isEqual:previousIndexPath]) { + if ((newIndexPath == nil) || (previousIndexPath == nil) || [newIndexPath isEqual:previousIndexPath]) { return; }