|
@@ -308,6 +308,15 @@ extension KMBatchImageToPDFView {
|
|
|
openPanel.beginSheetModal(for: self.window!) { (result) in
|
|
|
if result == .OK {
|
|
|
guard let url = openPanel.url else { return }
|
|
|
+
|
|
|
+ if !url.path.isPDFValid() {
|
|
|
+ let alert = NSAlert()
|
|
|
+ alert.alertStyle = .critical
|
|
|
+ alert.messageText = NSLocalizedString("An error occurred while opening this document. The file is damaged and could not be repaired.", comment: "")
|
|
|
+ alert.runModal()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
guard let document = CPDFDocument(url: url) else {
|
|
|
let alert = NSAlert()
|
|
|
alert.alertStyle = .critical
|