From c042d20b530335f338c7756865c15b0b7639260f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Philipp=20Sch=C3=BCle?=
Date: Tue, 17 Sep 2024 12:10:57 +0200
Subject: [PATCH] fix(Setup/Update): app state might be null
---
tine20/Setup/Update/Abstract.php | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tine20/Setup/Update/Abstract.php b/tine20/Setup/Update/Abstract.php
index 5c731dff83..8bef9b3e2c 100644
--- a/tine20/Setup/Update/Abstract.php
+++ b/tine20/Setup/Update/Abstract.php
@@ -123,8 +123,9 @@ public function setApplicationVersion($_applicationName, $_version)
public function addApplicationUpdate($_applicationName, $_version, $_updateKey)
{
$application = Tinebase_Application::getInstance()->getApplicationByName($_applicationName);
- if (!($state = json_decode(Tinebase_Application::getInstance()->getApplicationState($application->getId(),
- Tinebase_Application::STATE_UPDATES, true), true))) {
+ $appState = Tinebase_Application::getInstance()->getApplicationState($application->getId(),
+ Tinebase_Application::STATE_UPDATES, true);
+ if ($appState === null || !($state = json_decode($appState, true))) {
$state = [];
}
$state[$_updateKey] = Tinebase_DateTime::now()->format(Tinebase_Record_Abstract::ISO8601LONG);