fix first time updatecheck run when null is returned from Update::getUpdateCheckData()

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-07-24 11:51:32 +02:00
parent b6267e610a
commit 4d1a6728f6

View File

@@ -68,9 +68,9 @@ class Froxlor extends ApiCommand
$uc_data = Update::getUpdateCheckData();
$force_ucheck = $this->getBoolParam('force', true, 0);
$response = $uc_data['data'];
$response = $uc_data['data'] ?? [];
if (empty($uc_data) || $uc_data['ts'] + self::UPDATE_CHECK_INTERVAL < time() || $uc_data['channel'] != Settings::Get('system.update_channel') || $force_ucheck) {
if (empty($uc_data) || empty($response) || $uc_data['ts'] + self::UPDATE_CHECK_INTERVAL < time() || $uc_data['channel'] != Settings::Get('system.update_channel') || $force_ucheck) {
// log our actions
$this->logger()->logAction(FroxlorLogger::ADM_ACTION, LOG_NOTICE, "[API] checking for updates");