mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 01:30:50 -04:00
fix(core) null safe on metadata
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
This commit is contained in:
parent
9b6424e5ca
commit
681498a050
2 changed files with 10 additions and 7 deletions
|
|
@ -2139,6 +2139,14 @@
|
|||
<code>$file</code>
|
||||
</MoreSpecificImplementedParamType>
|
||||
</file>
|
||||
<file src="lib/private/Files/Cache/Scanner.php">
|
||||
<RedundantCondition>
|
||||
<code>$metadataQuery?->extractMetadata($data)->asArray() ?? []</code>
|
||||
</RedundantCondition>
|
||||
<TypeDoesNotContainNull>
|
||||
<code>$metadataQuery?->extractMetadata($data)->asArray() ?? []</code>
|
||||
</TypeDoesNotContainNull>
|
||||
</file>
|
||||
<file src="lib/private/Files/Cache/Scanner.php">
|
||||
<InvalidArgument>
|
||||
<code>self::SCAN_RECURSIVE_INCOMPLETE</code>
|
||||
|
|
|
|||
|
|
@ -194,13 +194,8 @@ class QuerySearchHelper {
|
|||
$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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue