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: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
cdfffe7bda
commit
569b8413d4
|
@ -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 = [];
|
||||||
|
|
Loading…
Reference in New Issue