From 3fa13b48fcc8cc7695bf0d465a8d0cd87a5d82d9 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 18 Dec 2017 15:55:46 +0100 Subject: handle exceptions in SMB::stat Signed-off-by: Robin Appelman --- apps/files_external/lib/Lib/Storage/SMB.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'apps/files_external/lib') diff --git a/apps/files_external/lib/Lib/Storage/SMB.php b/apps/files_external/lib/Lib/Storage/SMB.php index 557dafda72c..66a03548ea7 100644 --- a/apps/files_external/lib/Lib/Storage/SMB.php +++ b/apps/files_external/lib/Lib/Storage/SMB.php @@ -205,12 +205,14 @@ class SMB extends Common implements INotifyStorage { return $result; } - /** - * @param string $path - * @return array - */ public function stat($path) { - $result = $this->formatInfo($this->getFileInfo($path)); + try { + $result = $this->formatInfo($this->getFileInfo($path)); + } catch (ForbiddenException $e) { + return false; + } catch (NotFoundException $e) { + return false; + } if ($this->remoteIsShare() && $this->isRootDir($path)) { $result['mtime'] = $this->shareMTime(); } -- cgit v1.2.3