Browse Source

ATV: add missing sanity check

(cherry picked from commit 2c7e82b5bb98dc86a8ab16d54eab52906a9dc609)
Felix Paul Kühne 7 years ago
parent
commit
74488f5d4c
1 changed files with 3 additions and 1 deletions
  1. 3 1
      Apple-TV/VLCServerListTVViewController.m

+ 3 - 1
Apple-TV/VLCServerListTVViewController.m

@@ -344,7 +344,9 @@
         for (NSUInteger index = 0; index < itemsCount; ++index) {
         for (NSUInteger index = 0; index < itemsCount; ++index) {
             NSIndexPath *indexPath = [NSIndexPath indexPathForItem:index inSection:section];
             NSIndexPath *indexPath = [NSIndexPath indexPathForItem:index inSection:section];
             id<VLCLocalNetworkService> service = [discoveryController networkServiceForIndexPath:indexPath];
             id<VLCLocalNetworkService> service = [discoveryController networkServiceForIndexPath:indexPath];
-            [newNetworkServices addObject:service];
+            if (service != nil) {
+                [newNetworkServices addObject:service];
+            }
         }
         }
     }
     }