Browse Source

【综合】文件对比crash修复

tangchao 1 year ago
parent
commit
57a793fcda

+ 32 - 0
PDF Office/PDF Master.xcodeproj/xcuserdata/kdanmobile.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -404,5 +404,37 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "B9AE825C-E3D1-4E9D-8FDC-8B5941F8A4D0"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "PDF Master/Class/PDFTools/Compare/View/KMCompareView.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "103"
+            endingLineNumber = "103"
+            landmarkName = "init(pdfDocument:)"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "17F1BAD1-3A41-4B81-A1B9-53BAEE52FB6D"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "PDF Master/Class/PDFTools/Compare/View/KMCompareView.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "115"
+            endingLineNumber = "115"
+            landmarkName = "init(filePath:password:)"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>

+ 7 - 4
PDF Office/PDF Master/Class/PDFTools/Compare/View/KMCompareView.swift

@@ -289,10 +289,11 @@ extension KMCompareView {
             let document: PDFDocument = PDFDocument.init(url: NSURL(fileURLWithPath: filePath) as URL) ?? PDFDocument()
             let cDocument: CPDFDocument = CPDFDocument.init(url: NSURL(fileURLWithPath: filePath) as URL)!
             let file: KMFileAttribute = KMFileAttribute()
-            file.pdfDocument = cDocument
-            file.myPDFDocument = document
-            file.filePath = filePath
+//            file.pdfDocument = cDocument
+//            file.myPDFDocument = document
             file.password = password
+            file.filePath = filePath
+
             
             document.unlock(withPassword: password)
             cDocument.unlock(withPassword: password)
@@ -771,7 +772,9 @@ extension KMCompareView {
 //                    }
                     
                     self.updateDocument(filePath: filePath, isNew: isNew) { [unowned self] file in
-                        self.addFilePath(filePath: filePath, isNew: isNew, password: file?.password ?? "")
+                        if let _ = file {
+                            self.addFilePath(filePath: filePath, isNew: isNew, password: file?.password ?? "")
+                        }
                     }
                 }
             }