[vlc-commits] macosx: add missing sanity check
Felix Paul Kühne
git at videolan.org
Mon Oct 21 09:16:22 CEST 2019
vlc | branch: master | Felix Paul Kühne <felix at feepk.net> | Sun Oct 20 15:52:43 2019 +0200| [d585569d5ac7412232171633ffdbf5a451131dc9] | committer: Felix Paul Kühne
macosx: add missing sanity check
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d585569d5ac7412232171633ffdbf5a451131dc9
---
modules/gui/macosx/media-source/VLCMediaSourceBaseDataSource.m | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/modules/gui/macosx/media-source/VLCMediaSourceBaseDataSource.m b/modules/gui/macosx/media-source/VLCMediaSourceBaseDataSource.m
index ff7d1ebe08..3994cde2a8 100644
--- a/modules/gui/macosx/media-source/VLCMediaSourceBaseDataSource.m
+++ b/modules/gui/macosx/media-source/VLCMediaSourceBaseDataSource.m
@@ -380,7 +380,11 @@ NSString *VLCMediaSourceTableViewCellIdentifier = @"VLCMediaSourceTableViewCellI
if (_gridViewMode) {
if (self.collectionView.dataSource == self) {
NSInteger index = [_mediaSources indexOfObject:aNotification.object];
- [self.collectionView reloadSections:[NSIndexSet indexSetWithIndex:index]];
+ if (self.collectionView.numberOfSections >= index) {
+ [self.collectionView reloadSections:[NSIndexSet indexSetWithIndex:index]];
+ } else {
+ [self.collectionView reloadData];
+ }
} else {
[self.collectionView reloadData];
}
More information about the vlc-commits
mailing list