瀏覽代碼

fix runtime exception

Felix Paul Kühne 9 年之前
父節點
當前提交
89c849cec1
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      SharedSources/ServerBrowsing/UPnP/VLCNetworkServerBrowserUPnP.m

+ 3 - 0
SharedSources/ServerBrowsing/UPnP/VLCNetworkServerBrowserUPnP.m

@@ -238,6 +238,9 @@
 
             NSArray<NSString *>* protocolStrings = [[mediaItem uriCollection] allKeys];
             protocolStrings = [protocolStrings filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(NSString * _Nonnull evaluatedObject, NSDictionary<NSString *,id> * _Nullable bindings) {
+                if (evaluatedObject == nil || ![evaluatedObject isKindOfClass:[NSString class]])
+                    return NO;
+
                 if ([evaluatedObject containsString:@"http-get:*:video/"])
                     return YES;
                 if ([evaluatedObject containsString:@"http-get:*:audio/"])