diff --git a/lib/private/Files/Cache/QuerySearchHelper.php b/lib/private/Files/Cache/QuerySearchHelper.php index d8c5e66e12951..77ffb8abcde3d 100644 --- a/lib/private/Files/Cache/QuerySearchHelper.php +++ b/lib/private/Files/Cache/QuerySearchHelper.php @@ -194,13 +194,8 @@ public function searchInCaches(ISearchQuery $searchQuery, array $caches): array $result = $query->execute(); $files = $result->fetchAll(); - $rawEntries = array_map(function (array $data) use ($metadataQuery) { - // migrate to null safe ... - if ($metadataQuery === null) { - $data['metadata'] = []; - } else { - $data['metadata'] = $metadataQuery->extractMetadata($data)->asArray(); - } + $rawEntries = array_map(function (array $data) use ($metadataQuery): CacheEntry { + $data['metadata'] = $metadataQuery?->extractMetadata($data)->asArray() ?? []; return Cache::cacheEntryFromData($data, $this->mimetypeLoader); }, $files);