소스 검색

Fix crash when trying to parse non-existing library xmls

Signed-off-by: Felix Paul Kühne <fkuehne@videolan.org>
Sylver Bruneau 10 년 전
부모
커밋
7367da5a0f
1개의 변경된 파일5개의 추가작업 그리고 4개의 파일을 삭제
  1. 5 4
      Sources/VLCSharedLibraryParser.m

+ 5 - 4
Sources/VLCSharedLibraryParser.m

@@ -46,10 +46,11 @@
 {
     NSMutableArray *mutableObjectList = [[NSMutableArray alloc] init];
     mutableObjectList = [self VLCLibraryServerParser:adress port:port];
-    NSString *identifier = [[mutableObjectList objectAtIndex:0] objectForKey:@"identifier"];
-    if ([identifier isEqualToString:@"org.videolan.vlc-ios"])
-        return YES;
-
+    if (mutableObjectList.count > 0) {
+        NSString *identifier = [[mutableObjectList objectAtIndex:0] objectForKey:@"identifier"];
+        if ([identifier isEqualToString:@"org.videolan.vlc-ios"])
+            return YES;
+    }
     return NO;
 }