From cb1c0d7221a3aafb4337b065814f161d7d18eb33 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Thu, 13 Feb 2020 22:03:44 +0100 Subject: [PATCH] when we receive intentional empty whats new info, do not try to show it Signed-off-by: Arthur Schiwon --- lib/private/Updater/ChangesCheck.php | 6 +++++- tests/lib/Updater/ChangesCheckTest.php | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/private/Updater/ChangesCheck.php b/lib/private/Updater/ChangesCheck.php index f1f44cc59c..7346ceab6b 100644 --- a/lib/private/Updater/ChangesCheck.php +++ b/lib/private/Updater/ChangesCheck.php @@ -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; } /** diff --git a/tests/lib/Updater/ChangesCheckTest.php b/tests/lib/Updater/ChangesCheckTest.php index a979007573..30cb9df295 100644 --- a/tests/lib/Updater/ChangesCheckTest.php +++ b/tests/lib/Updater/ChangesCheckTest.php @@ -279,6 +279,10 @@ class ChangesCheckTest extends TestCase { ], ] ], + [ # 4 - empty + '', + [] + ], ]; }