Skip to content

Commit

Permalink
Merge pull request #5959 from nextcloud/perf-workspace-service-get-file
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusknorr authored Jun 27, 2024
2 parents d5a5896 + 5020d9b commit 89a2c6c
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions lib/Service/WorkspaceService.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,13 @@ public function __construct(IL10N $l10n) {

public function getFile(Folder $folder): ?File {
foreach ($this->getSupportedFilenames() as $filename) {
if ($folder->nodeExists($filename)) {
try {
$file = $folder->get($filename);
if ($file instanceof File) {
return $file;
}
} catch (NotFoundException|StorageInvalidException) {
return null;
try {
$file = $folder->get($filename);
if ($file instanceof File) {
return $file;
}
} catch (NotFoundException|StorageInvalidException) {
continue;
}
}
return null;
Expand Down

0 comments on commit 89a2c6c

Please sign in to comment.