mirror of https://code.videolan.org/videolan/vlc
macosx: Avoid crashing upon clicking collection view item when receiving nil index path
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
This commit is contained in:
parent
f3693fe723
commit
f54dc525de
|
@ -297,6 +297,10 @@ const CGFloat VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95;
|
||||||
[self.collectionView.dataSource conformsToProtocol:@protocol(VLCLibraryCollectionViewDataSource)]) {
|
[self.collectionView.dataSource conformsToProtocol:@protocol(VLCLibraryCollectionViewDataSource)]) {
|
||||||
NSObject<VLCLibraryCollectionViewDataSource> * const dataSource = (NSObject<VLCLibraryCollectionViewDataSource> *)self.collectionView.dataSource;
|
NSObject<VLCLibraryCollectionViewDataSource> * const dataSource = (NSObject<VLCLibraryCollectionViewDataSource> *)self.collectionView.dataSource;
|
||||||
NSIndexPath * const indexPath = [dataSource indexPathForLibraryItem:self.representedItem.item];
|
NSIndexPath * const indexPath = [dataSource indexPathForLibraryItem:self.representedItem.item];
|
||||||
|
if (indexPath == nil) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
NSSet<NSIndexPath *> * const indexPathSet = [NSSet setWithObject:indexPath];
|
NSSet<NSIndexPath *> * const indexPathSet = [NSSet setWithObject:indexPath];
|
||||||
[self.collectionView deselectItemsAtIndexPaths:indexPathSet];
|
[self.collectionView deselectItemsAtIndexPaths:indexPathSet];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue