FIX Handle invalid json data
This commit is contained in:
parent
ffe1bc8fa2
commit
fe5e87598f
|
@ -529,7 +529,10 @@ class TestSessionEnvironment
|
||||||
public function getState()
|
public function getState()
|
||||||
{
|
{
|
||||||
$path = Director::getAbsFile($this->getFilePath());
|
$path = Director::getAbsFile($this->getFilePath());
|
||||||
return (file_exists($path ?? '')) ? json_decode(file_get_contents($path)) : new stdClass;
|
if (file_exists($path ?? '')) {
|
||||||
|
return json_decode(file_get_contents($path)) ?: new stdClass;
|
||||||
|
}
|
||||||
|
return new stdClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue