diff --git a/Classes/Hooks/ButtonBarHook.php b/Classes/Hooks/ButtonBarHook.php index 16ec5167..02bac70f 100644 --- a/Classes/Hooks/ButtonBarHook.php +++ b/Classes/Hooks/ButtonBarHook.php @@ -34,16 +34,19 @@ public function getButtons(array $params, ButtonBar $buttonBar): array return $buttons; } - /** @var array{uid: int, doktype: int, module: string} $page */ + /** @var array{uid: int, doktype?: int, module?: string}|null $page */ $page = BackendUtility::getRecord( 'pages', $queryParams['id'], 'uid,module,doktype' ); + if ($page === null) { + return $buttons; + } if ( - (int)$page['doktype'] !== PageRepository::DOKTYPE_SYSFOLDER - || $page['module'] !== 'glossary' + (int)($page['doktype'] ?? 0) !== PageRepository::DOKTYPE_SYSFOLDER + || ($page['module'] ?? '') !== 'glossary' ) { return $buttons; }