marinofaggiana 4 år sedan
förälder
incheckning
f1910de237

+ 11 - 13
iOSClient/Utility/NCUtilityFileSystem.swift

@@ -99,24 +99,22 @@ class NCUtilityFileSystem: NSObject {
     
     @objc func moveFile(atPath: String, toPath: String) {
 
-        do {
-            try FileManager.default.removeItem(atPath: toPath)
-            try FileManager.default.copyItem(atPath: atPath, toPath: toPath)
-            try FileManager.default.removeItem(atPath: atPath)
-        }
-        catch {}
-        
+        if atPath == toPath { return }
+    
+        try? FileManager.default.removeItem(atPath: toPath)
+        try? FileManager.default.copyItem(atPath: atPath, toPath: toPath)
+        try? FileManager.default.removeItem(atPath: atPath)
     }
     
     @objc func moveFileInBackground(atPath: String, toPath: String) {
         
+        if atPath == toPath { return }
+        
         DispatchQueue.global().async {
-            do {
-                try FileManager.default.removeItem(atPath: toPath)
-                try FileManager.default.copyItem(atPath: atPath, toPath: toPath)
-                try FileManager.default.removeItem(atPath: atPath)
-            }
-            catch {}
+            
+            try? FileManager.default.removeItem(atPath: toPath)
+            try? FileManager.default.copyItem(atPath: atPath, toPath: toPath)
+            try? FileManager.default.removeItem(atPath: atPath)
         }
     }
 }

+ 0 - 1
iOSClient/Viewer/NCViewerRichdocument/NCViewerRichdocument.swift

@@ -225,7 +225,6 @@ class NCViewerRichdocument: UIViewController, WKNavigationDelegate, WKScriptMess
                                 }
                                 
                                 if type == "print" {
-                                    
                                     let pic = UIPrintInteractionController.shared
                                     let printInfo = UIPrintInfo.printInfo()
                                     printInfo.outputType = UIPrintInfo.OutputType.general