Skip to content

Commit da7c2c8

Browse files
committed
fix(ocm): ignore cache if not setup
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
1 parent 43c6e85 commit da7c2c8

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
@@ -83,9 +83,11 @@ public function discover(string $remote, bool $skipCache = false): IOCMProvider
8383
throw new OCMProviderException('Previous discovery failed.');
8484
}
8585

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

0 commit comments

Comments
 (0)