Browse Source

【首页-合并】文档添加到列表,再从finder中删除这些文档,合并直接崩溃 -- 修复

lizhe 10 months ago
parent
commit
b28ef278e0

+ 5 - 1
PDF Office/PDF Master/Class/PDFTools/Merge/MergeNew/KMMergeWindowController.swift

@@ -189,7 +189,11 @@ extension KMMergeWindowController {
             
             allPage = file.bAllPage
             
-            let tDocument = PDFDocument(url: NSURL(fileURLWithPath: file.filePath) as URL)!
+            /*防止文件被地址变换后crash*/
+            guard let tDocument = PDFDocument(url: NSURL(fileURLWithPath: file.filePath) as URL) else {
+                print("文件不存在")
+                return
+            }
             
             var outlineArray: [PDFOutline] = []