From 5b77099612286061f8a48618ffa513dcf6aa4c31 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 16 Feb 2022 15:23:52 +0100 Subject: [PATCH] handle invilid type when listing directory in smb just handle it as an empty directory Signed-off-by: Robin Appelman --- apps/files_external/lib/Lib/Storage/SMB.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/files_external/lib/Lib/Storage/SMB.php b/apps/files_external/lib/Lib/Storage/SMB.php index 28a2d6de7cc..78918343cee 100644 --- a/apps/files_external/lib/Lib/Storage/SMB.php +++ b/apps/files_external/lib/Lib/Storage/SMB.php @@ -43,6 +43,7 @@ use Icewind\SMB\Exception\ConnectException; use Icewind\SMB\Exception\Exception; use Icewind\SMB\Exception\ForbiddenException; use Icewind\SMB\Exception\InvalidArgumentException; +use Icewind\SMB\Exception\InvalidTypeException; use Icewind\SMB\Exception\NotFoundException; use Icewind\SMB\Exception\OutOfSpaceException; use Icewind\SMB\Exception\TimedOutException; @@ -241,6 +242,8 @@ class SMB extends Common implements INotifyStorage { } catch (ForbiddenException $e) { $this->logger->critical($e->getMessage(), ['exception' => $e]); throw new NotPermittedException(); + } catch (InvalidTypeException $e) { + return; } foreach ($files as $file) { $this->statCache[$path . '/' . $file->getName()] = $file;