when we receive intentional empty whats new info, do not try to show it

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2020-02-13 22:03:44 +01:00 committed by backportbot[bot]
parent 1185289509
commit cb1c0d7221
2 changed files with 9 additions and 1 deletions

View file

@ -55,7 +55,11 @@ class ChangesCheck {
public function getChangesForVersion(string $version): array {
$version = $this->normalizeVersion($version);
$changesInfo = $this->mapper->getChanges($version);
return json_decode($changesInfo->getData(), true);
$changesData = json_decode($changesInfo->getData(), true);
if(empty($changesData)) {
throw new DoesNotExistException();
}
return $changesData;
}
/**

View file

@ -279,6 +279,10 @@ class ChangesCheckTest extends TestCase {
],
]
],
[ # 4 - empty
'',
[]
],
];
}