UpdateState is empty if no update is available
This leads to log messages such as "Undefined index: updaterEnabled at /media/psf/nextcloud/apps/updatenotification/lib/Controller/AdminController.php#116".
This commit is contained in:
parent
ad9b154700
commit
98df88950f
|
@ -113,7 +113,7 @@ class AdminController extends Controller implements ISettings {
|
||||||
'channels' => $channels,
|
'channels' => $channels,
|
||||||
'newVersionString' => (empty($updateState['updateVersion'])) ? '' : $updateState['updateVersion'],
|
'newVersionString' => (empty($updateState['updateVersion'])) ? '' : $updateState['updateVersion'],
|
||||||
'downloadLink' => (empty($updateState['downloadLink'])) ? '' : $updateState['downloadLink'],
|
'downloadLink' => (empty($updateState['downloadLink'])) ? '' : $updateState['downloadLink'],
|
||||||
'updaterEnabled' => $updateState['updaterEnabled'],
|
'updaterEnabled' => (empty($updateState['updaterEnabled'])) ? false : $updateState['updaterEnabled'],
|
||||||
|
|
||||||
'notify_groups' => implode('|', $notifyGroups),
|
'notify_groups' => implode('|', $notifyGroups),
|
||||||
];
|
];
|
||||||
|
|
|
@ -161,7 +161,7 @@ class AdminControllerTest extends TestCase {
|
||||||
$this->updateChecker
|
$this->updateChecker
|
||||||
->expects($this->once())
|
->expects($this->once())
|
||||||
->method('getUpdateState')
|
->method('getUpdateState')
|
||||||
->willReturn(['updaterEnabled' => false]);
|
->willReturn([]);
|
||||||
|
|
||||||
$params = [
|
$params = [
|
||||||
'isNewVersionAvailable' => false,
|
'isNewVersionAvailable' => false,
|
||||||
|
|
Loading…
Reference in New Issue