aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorblizzz <blizzz@arthur-schiwon.de>2020-02-14 10:06:55 +0100
committerGitHub <noreply@github.com>2020-02-14 10:06:55 +0100
commitc7b7ee66cf679ef30c0151a55bdb8a489bd1eeac (patch)
tree77e6f11da6d8c70a70e597dfde18845a6f46e000
parent1199e578960f0ca96c6418ad6914dc554da6474a (diff)
parentb1a6f66fd9676e9d7c9ceed5a10d07806790ae02 (diff)
downloadnextcloud-server-c7b7ee66cf679ef30c0151a55bdb8a489bd1eeac.tar.gz
nextcloud-server-c7b7ee66cf679ef30c0151a55bdb8a489bd1eeac.zip
Merge pull request #19465 from nextcloud/enh/noid/empty-whatsnew
when we receive intentional empty whats new info, do not try to show it
-rw-r--r--lib/private/Updater/ChangesCheck.php6
-rw-r--r--tests/lib/Updater/ChangesCheckTest.php4
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/private/Updater/ChangesCheck.php b/lib/private/Updater/ChangesCheck.php
index f1f44cc59c8..7346ceab6b1 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 a979007573d..30cb9df2956 100644
--- a/tests/lib/Updater/ChangesCheckTest.php
+++ b/tests/lib/Updater/ChangesCheckTest.php
@@ -279,6 +279,10 @@ class ChangesCheckTest extends TestCase {
],
]
],
+ [ # 4 - empty
+ '',
+ []
+ ],
];
}