]> source.dussan.org Git - nextcloud-server.git/commitdiff
handle deleting non existing files
authorRobin Appelman <icewind@owncloud.com>
Mon, 9 Feb 2015 12:13:39 +0000 (13:13 +0100)
committerThomas Müller <thomas.mueller@tmit.eu>
Mon, 16 Feb 2015 12:52:11 +0000 (13:52 +0100)
apps/files_external/lib/smb.php

index 34f91defdccbceddd125819e643b7253c6e8f6d7..a61131401985dc74fa754fbd93cb0b6b2e74d73e 100644 (file)
@@ -114,13 +114,17 @@ class SMB extends Common {
         * @return bool
         */
        public function unlink($path) {
-               if ($this->is_dir($path)) {
-                       return $this->rmdir($path);
-               } else {
-                       $path = $this->buildPath($path);
-                       unset($this->statCache[$path]);
-                       $this->share->del($path);
-                       return true;
+               try {
+                       if ($this->is_dir($path)) {
+                               return $this->rmdir($path);
+                       } else {
+                               $path = $this->buildPath($path);
+                               unset($this->statCache[$path]);
+                               $this->share->del($path);
+                               return true;
+                       }
+               } catch (NotFoundException $e) {
+                       return false;
                }
        }