Merge pull request #7556 from nextcloud/smb-stat-exception

handle exceptions in SMB::stat
This commit is contained in:
Morris Jobke 2017-12-18 22:31:05 +01:00 committed by GitHub
commit b01d20c0d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 5 deletions

View File

@ -207,12 +207,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();
}