diff --git a/Classes/Domain/Service/PermissionTrait.php b/Classes/Domain/Service/PermissionTrait.php index fdf328c..7e5b975 100644 --- a/Classes/Domain/Service/PermissionTrait.php +++ b/Classes/Domain/Service/PermissionTrait.php @@ -72,7 +72,11 @@ private function isAuthenticatedForRecord(int $identifier, string $table): bool $pageIdentifier = $this->getPageIdentifierFromRecord($identifier, $table); if ($pageIdentifier > 0) { - return $this->isAuthenticatedForPageRow($this->getPageRowFromPageIdentifier($pageIdentifier)); + $pageRecord = $this->getPageRowFromPageIdentifier($pageIdentifier); + if ($pageRecord === []) { + return false; + } + return $this->isAuthenticatedForPageRow($pageRecord); } return false; } @@ -110,13 +114,13 @@ protected function getPageIdentifierFromRecord(int $identifier, string $table): /** * @param int $identifier - * @return array|int + * @return array * @throws ExceptionDbal */ protected function getPageRowFromPageIdentifier(int $identifier): array { $queryBuilder = DatabaseUtility::getQueryBuilderForTable('pages'); - return (array)$queryBuilder + $row = $queryBuilder ->select('*') ->from('pages') ->where( @@ -125,5 +129,6 @@ protected function getPageRowFromPageIdentifier(int $identifier): array ->setMaxResults(1) ->executeQuery() ->fetchAssociative(); + return $row ?: []; } }