ソースを参照

Fix runtime exception

(cherry picked from commit e2fcfb7fa3c6d1aa0aac2d0fb3d9c517779b1f8a)
Felix Paul Kühne 9 年 前
コミット
9de80cd233
1 ファイル変更7 行追加2 行削除
  1. 7 2
      Sources/VLCHTTPConnection.m

+ 7 - 2
Sources/VLCHTTPConnection.m

@@ -514,11 +514,16 @@
 - (NSString *)_checkIfSubtitleWasFound:(NSString *)filePath
 {
     NSString *subtitlePath;
+    NSString *fileSub;
+    NSString *currentPath;
+
     NSString *fileName = [[filePath lastPathComponent] stringByDeletingPathExtension];
+    if (fileName == nil)
+        return nil;
+
     NSMutableArray *listOfSubtitles = [self _listOfSubtitles];
-    NSString *fileSub;
     NSUInteger count = listOfSubtitles.count;
-    NSString *currentPath;
+
     for (NSUInteger i = 0; i < count; i++) {
         currentPath = listOfSubtitles[i];
         fileSub = [NSString stringWithFormat:@"%@", currentPath];