Skip to content
Snippets Groups Projects
Unverified Commit 569b8413 authored by Roeland Jago Douma's avatar Roeland Jago Douma
Browse files

Add extra check so we don't error out on type


json_decode can return false if we have invalid data.
In that case just assume there was nothing cached

Signed-off-by: default avatarRoeland Jago Douma <roeland@famdouma.nl>
parent cdfffe7b
No related branches found
No related tags found
No related merge requests found
...@@ -65,7 +65,10 @@ class DiscoveryService implements IDiscoveryService { ...@@ -65,7 +65,10 @@ class DiscoveryService implements IDiscoveryService {
// Check the cache first // Check the cache first
$cacheData = $this->cache->get($remote . '#' . $service); $cacheData = $this->cache->get($remote . '#' . $service);
if($cacheData) { if($cacheData) {
return json_decode($cacheData, true); $data = json_decode($cacheData, true);
if (\is_array($data)) {
return $data;
}
} }
$discoveredServices = []; $discoveredServices = [];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment