Skip to content

Commit b01d20c

Browse files
authored
Merge pull request #7556 from nextcloud/smb-stat-exception
handle exceptions in SMB::stat
2 parents e294323 + 3fa13b4 commit b01d20c

File tree

1 file changed

+7
-5
lines changed
  • apps/files_external/lib/Lib/Storage

1 file changed

+7
-5
lines changed

apps/files_external/lib/Lib/Storage/SMB.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,14 @@ public function rename($source, $target) {
207207
return $result;
208208
}
209209

210-
/**
211-
* @param string $path
212-
* @return array
213-
*/
214210
public function stat($path) {
215-
$result = $this->formatInfo($this->getFileInfo($path));
211+
try {
212+
$result = $this->formatInfo($this->getFileInfo($path));
213+
} catch (ForbiddenException $e) {
214+
return false;
215+
} catch (NotFoundException $e) {
216+
return false;
217+
}
216218
if ($this->remoteIsShare() && $this->isRootDir($path)) {
217219
$result['mtime'] = $this->shareMTime();
218220
}

0 commit comments

Comments
 (0)