Merge pull request #19471 from nextcloud/backport/19465/stable17

[stable17] when we receive intentional empty whats new info, do not try to show it
This commit is contained in:
Joas Schilling 2020-02-17 12:40:48 +01:00 committed by GitHub
commit 1e14781d74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -53,7 +53,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
'',
[]
],
];
}