Skip to content

Commit 89a2c6c

Browse files
authored
Merge pull request #5959 from nextcloud/perf-workspace-service-get-file
2 parents d5a5896 + 5020d9b commit 89a2c6c

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

lib/Service/WorkspaceService.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,13 @@ public function __construct(IL10N $l10n) {
2929

3030
public function getFile(Folder $folder): ?File {
3131
foreach ($this->getSupportedFilenames() as $filename) {
32-
if ($folder->nodeExists($filename)) {
33-
try {
34-
$file = $folder->get($filename);
35-
if ($file instanceof File) {
36-
return $file;
37-
}
38-
} catch (NotFoundException|StorageInvalidException) {
39-
return null;
32+
try {
33+
$file = $folder->get($filename);
34+
if ($file instanceof File) {
35+
return $file;
4036
}
37+
} catch (NotFoundException|StorageInvalidException) {
38+
continue;
4139
}
4240
}
4341
return null;

0 commit comments

Comments
 (0)