From e98983485f91b5ad57710266a360d6c250b87928 Mon Sep 17 00:00:00 2001
From: Robin Appelman <icewind@owncloud.com>
Date: Mon, 9 Feb 2015 13:13:39 +0100
Subject: [PATCH] handle deleting non existing files

---
 apps/files_external/lib/smb.php | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/apps/files_external/lib/smb.php b/apps/files_external/lib/smb.php
index 34f91defdc..a611314019 100644
--- a/apps/files_external/lib/smb.php
+++ b/apps/files_external/lib/smb.php
@@ -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;
 		}
 	}
 
-- 
GitLab