handle invilid type when listing directory in smb

just handle it as an empty directory

Signed-off-by: Robin Appelman <robin@icewind.nl>
pull/31215/head
Robin Appelman 2022-02-16 15:23:52 +07:00
parent 69a6efba47
commit 5b77099612
No known key found for this signature in database
GPG Key ID: 42B69D8A64526EFB
1 changed files with 3 additions and 0 deletions

@ -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;