diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php index f147c51fcf671..f8f780e53d837 100644 --- a/apps/dav/lib/Connector/Sabre/File.php +++ b/apps/dav/lib/Connector/Sabre/File.php @@ -473,11 +473,13 @@ 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());