Fixed crash when scrolling to first element of transient site.
[FIXED] The first cell of the transient site isn't a Delete button, this caused a crash due to it being rendered with an unexpected type.
This commit is contained in:
parent
db55634ab2
commit
d8e2707ac0
@ -99,18 +99,20 @@
|
|||||||
- (MPPasswordLargeCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
|
- (MPPasswordLargeCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||||
|
|
||||||
MPPasswordLargeCell *cell;
|
MPPasswordLargeCell *cell;
|
||||||
if (indexPath.item == 0)
|
if (!self.transientSite && indexPath.item == 0) {
|
||||||
cell = [MPPasswordLargeDeleteCell dequeueCellFromCollectionView:collectionView atIndexPath:indexPath];
|
cell = [MPPasswordLargeDeleteCell dequeueCellFromCollectionView:collectionView atIndexPath:indexPath];
|
||||||
else
|
[cell updateWithElement:self.mainElement];
|
||||||
|
} else {
|
||||||
cell = [MPPasswordLargeCell dequeueCellWithType:[self typeForContentIndexPath:indexPath] fromCollectionView:collectionView
|
cell = [MPPasswordLargeCell dequeueCellWithType:[self typeForContentIndexPath:indexPath] fromCollectionView:collectionView
|
||||||
atIndexPath:indexPath];
|
atIndexPath:indexPath];
|
||||||
|
|
||||||
[cell prepareForReuse];
|
[cell prepareForReuse];
|
||||||
|
|
||||||
if (self.transientSite)
|
if (self.transientSite)
|
||||||
[cell updateWithTransientSite:self.transientSite];
|
[cell updateWithTransientSite:self.transientSite];
|
||||||
else
|
else
|
||||||
[cell updateWithElement:self.mainElement];
|
[cell updateWithElement:self.mainElement];
|
||||||
|
}
|
||||||
|
|
||||||
if (_scrolling)
|
if (_scrolling)
|
||||||
[cell willBeginDragging];
|
[cell willBeginDragging];
|
||||||
|
Loading…
Reference in New Issue
Block a user