Skip to content

Commit

Permalink
fix(Setup/Update): app state might be null
Browse files Browse the repository at this point in the history
  • Loading branch information
pschuele committed Sep 17, 2024
1 parent b509722 commit c042d20
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tine20/Setup/Update/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c042d20

Please sign in to comment.