Skip to content

Commit a4fee42

Browse files
ArtificialOwlbackportbot[bot]
authored andcommitted
fix(ocm): ignore cache if not setup
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
1 parent 3ae56aa commit a4fee42

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/private/OCM/OCMDiscoveryService.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,11 @@ public function discover(string $remote, bool $skipCache = false): ICapabilityAw
8484
throw new OCMProviderException('Previous discovery failed.');
8585
}
8686

87-
$provider->import(json_decode($cached ?? '', true, 8, JSON_THROW_ON_ERROR) ?? []);
88-
$this->remoteProviders[$remote] = $provider;
89-
return $provider;
87+
if ($cached !== null) {
88+
$provider->import(json_decode($cached, true, 8, JSON_THROW_ON_ERROR) ?? []);
89+
$this->remoteProviders[$remote] = $provider;
90+
return $provider;
91+
}
9092
} catch (JsonException|OCMProviderException $e) {
9193
$this->logger->warning('cache issue on ocm discovery', ['exception' => $e]);
9294
}

0 commit comments

Comments
 (0)