diff --git a/lib/Service/WorkspaceService.php b/lib/Service/WorkspaceService.php index 8ffa11a06ef..e6ba2370632 100644 --- a/lib/Service/WorkspaceService.php +++ b/lib/Service/WorkspaceService.php @@ -25,9 +25,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;