]> source.dussan.org Git - nextcloud-server.git/commitdiff
when we receive intentional empty whats new info, do not try to show it 19471/head
authorArthur Schiwon <blizzz@arthur-schiwon.de>
Thu, 13 Feb 2020 21:03:44 +0000 (22:03 +0100)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Fri, 14 Feb 2020 09:09:05 +0000 (09:09 +0000)
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
lib/private/Updater/ChangesCheck.php
tests/lib/Updater/ChangesCheckTest.php

index 095cf396e89e3f4ecfc73ccf443aef1ac31f82e6..575a9ceadaf34d4c86e25c686ac8aed2822a518e 100644 (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;
        }
 
        /**
index fe25e8cebaff566b48331c2481f2ac54ed420d81..2b1954ee48f2312b16987f04c8f09b5b1c24827d 100644 (file)
@@ -279,6 +279,10 @@ class ChangesCheckTest extends TestCase {
                                        ],
                                ]
                        ],
+                       [ # 4 - empty
+                               '',
+                               []
+                       ],
                ];
        }