diff --git a/lib/DAV/WorkspacePlugin.php b/lib/DAV/WorkspacePlugin.php index 52287825ca8..b7cd454bf1b 100644 --- a/lib/DAV/WorkspacePlugin.php +++ b/lib/DAV/WorkspacePlugin.php @@ -91,7 +91,7 @@ public function propFind(PropFind $propFind, INode $node) { if ($file instanceof File) { $cache = $this->cacheFactory->createDistributed('text_workspace'); $cacheKey = $file->getFileInfo()->getId() . '_' . $file->getFileInfo()->getEtag(); - if ($cachedContent = $cache->get($cacheKey)) { + if (($cachedContent = $cache->get($cacheKey)) !== null) { return $cachedContent; } diff --git a/lib/Service/WorkspaceService.php b/lib/Service/WorkspaceService.php index 8bec036a202..40e4d439821 100644 --- a/lib/Service/WorkspaceService.php +++ b/lib/Service/WorkspaceService.php @@ -30,9 +30,12 @@ public function __construct(IL10N $l10n) { public function getFile(Folder $folder): ?File { foreach ($this->getSupportedFilenames() as $filename) { try { - $file = $folder->get($filename); - if ($file instanceof File) { - return $file; + $exists = $folder->getStorage()->getCache()->get($folder->getInternalPath() . '/' . $filename); + if ($exists) { + $file = $folder->get($filename); + if ($file instanceof File) { + return $file; + } } } catch (NotFoundException|StorageInvalidException) { continue;