handle non-existing theme in user setting
This commit is contained in:
parent
2da821a68d
commit
98e9af8b8d
|
@ -6,6 +6,7 @@ use Engelsystem\Helpers\Authenticator;
|
||||||
use Engelsystem\Http\Request;
|
use Engelsystem\Http\Request;
|
||||||
use Twig\Extension\AbstractExtension as TwigExtension;
|
use Twig\Extension\AbstractExtension as TwigExtension;
|
||||||
use Twig\Extension\GlobalsInterface as GlobalsInterface;
|
use Twig\Extension\GlobalsInterface as GlobalsInterface;
|
||||||
|
use function array_key_exists;
|
||||||
|
|
||||||
class Globals extends TwigExtension implements GlobalsInterface
|
class Globals extends TwigExtension implements GlobalsInterface
|
||||||
{
|
{
|
||||||
|
@ -46,6 +47,10 @@ class Globals extends TwigExtension implements GlobalsInterface
|
||||||
$themeId = (int)$query;
|
$themeId = (int)$query;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (array_key_exists($themeId, $themes) === false) {
|
||||||
|
$themeId = 1;
|
||||||
|
}
|
||||||
|
|
||||||
$theme = $themes[$themeId];
|
$theme = $themes[$themeId];
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
Loading…
Reference in New Issue