From 9d7d562aae65eda1b1ee40ba9e6ff22ff6228eeb Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 24 Feb 2026 16:33:34 +0100 Subject: [PATCH] fix: handle case where we can't get the filesize after open in dav get Signed-off-by: Robin Appelman --- apps/dav/lib/Connector/Sabre/File.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php index 622264065cca5..5bc3f23b0b7b3 100644 --- a/apps/dav/lib/Connector/Sabre/File.php +++ b/apps/dav/lib/Connector/Sabre/File.php @@ -480,11 +480,14 @@ public function get() { } } + $logger = Server::get(LoggerInterface::class); // comparing current file size with the one in DB // if different, fix DB and refresh cache. + // $fsSize = $this->fileView->filesize($this->getPath()); - if ($this->getSize() !== $fsSize) { - $logger = Server::get(LoggerInterface::class); + if ($fsSize === false) { + $logger->warning('file not found on storage after successfully opening it'); + } elseif ($this->getSize() !== $fsSize) { $logger->warning('fixing cached size of file id=' . $this->getId() . ', cached size was ' . $this->getSize() . ', but the filesystem reported a size of ' . $fsSize); $this->getFileInfo()->getStorage()->getUpdater()->update($this->getFileInfo()->getInternalPath());