Skip to content

Commit 9667e8c

Browse files
Merge pull request #55326 from nextcloud/backport/55289/stable32
2 parents b60f193 + a4fee42 commit 9667e8c

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)