fix PHP TypeError: Argument #2 ($array) must be of type array, null given

This commit is contained in:
ralf 2023-06-16 10:16:20 +02:00
parent 0386a463ec
commit 51ff3f185d

View File

@ -135,8 +135,8 @@ class Nextmatch extends Etemplate\Widget
list($app) = explode('.', $this->attrs['template']);
}
// Check for sort preference. We only apply this on first load so it can be changed
if(array_key_exists($this->attrs['template'] . "_sort", $GLOBALS['egw_info']['user']['preferences'][$app]))
// Check for sort preference. We only apply this on first load, so it can be changed
if(array_key_exists($this->attrs['template'] . "_sort", $GLOBALS['egw_info']['user']['preferences'][$app] ?? []))
{
$send_value['sort'] = $GLOBALS['egw_info']['user']['preferences'][$app][$this->attrs['template'] . "_sort"];
}