[vlc-commits] [Git][videolan/vlc][master] 2 commits: macosx: Avoid crashing upon clicking collection view item when receiving nil index path

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sun May 12 13:35:21 UTC 2024



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
f54dc525 by Claudio Cambra at 2024-05-12T13:19:00+00:00
macosx: Avoid crashing upon clicking collection view item when receiving nil index path

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
928e8fea by Claudio Cambra at 2024-05-12T13:19:00+00:00
macosx: Log when receiving nil index path on mouse down of collection view item

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -


1 changed file:

- modules/gui/macosx/library/VLCLibraryCollectionViewItem.m


Changes:

=====================================
modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
=====================================
@@ -297,6 +297,11 @@ const CGFloat VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95;
                [self.collectionView.dataSource conformsToProtocol:@protocol(VLCLibraryCollectionViewDataSource)]) {
         NSObject<VLCLibraryCollectionViewDataSource> * const dataSource = (NSObject<VLCLibraryCollectionViewDataSource> *)self.collectionView.dataSource;
         NSIndexPath * const indexPath = [dataSource indexPathForLibraryItem:self.representedItem.item];
+        if (indexPath == nil) {
+            NSLog(@"Received nil indexPath for item %@!", self.representedItem.item.displayString);
+            return;
+        }
+
         NSSet<NSIndexPath *> * const indexPathSet = [NSSet setWithObject:indexPath];
         [self.collectionView deselectItemsAtIndexPaths:indexPathSet];
         



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/f3693fe723041082b997cf0eb685e230c9ac90f0...928e8fea7d1ed8c0917da12d32d960cab55e40a9

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/f3693fe723041082b997cf0eb685e230c9ac90f0...928e8fea7d1ed8c0917da12d32d960cab55e40a9
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list