浏览代码

VLCDownloadViewController: fix runtime exception

(cherry picked from commit 97a1449e9e605619b6d1aae343484e058f8276ca)
Felix Paul Kühne 7 年之前
父节点
当前提交
745a157974
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      Sources/VLCDownloadViewController.m

+ 6 - 2
Sources/VLCDownloadViewController.m

@@ -87,8 +87,12 @@
 - (void)viewWillAppear:(BOOL)animated
 {
     UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
-    if ([pasteboard containsPasteboardTypes:@[@"public.url"]])
-        self.urlField.text = [[pasteboard valueForPasteboardType:@"public.url"] absoluteString];
+    if ([pasteboard containsPasteboardTypes:@[@"public.url"]]) {
+        id pasteboardValue = [pasteboard valueForPasteboardType:@"public.url"];
+        if ([pasteboardValue respondsToSelector:@selector(absoluteString)]) {
+            self.urlField.text = [pasteboardValue absoluteString];
+        }
+    }
     [self _updateUI];
     [super viewWillAppear:animated];
 }