Skip to content

Commit

Permalink
Check if document array is null
Browse files Browse the repository at this point in the history
  • Loading branch information
chrizzor committed Jul 23, 2024
1 parent d7d6ce6 commit 32156a6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Classes/Controller/PageViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,11 @@ public function mainAction(): void

$this->addViewerJS();

$this->view->assign('docCount', count($this->documentArray));
$this->view->assign('docArray', $this->documentArray);
if ($this->documentArray !== null) {
$this->view->assign('docCount', count($this->documentArray));
$this->view->assign('docArray', $this->documentArray);
}

$this->view->assign('docPage', $this->requestData['docPage']);
$this->view->assign('docType', $this->document->getCurrentDocument()->tableOfContents[0]['type']);

Expand Down Expand Up @@ -462,7 +465,7 @@ protected function getFulltext(int $page): array
*/
protected function addViewerJS(): void
{
if (count($this->documentArray) > 1) {
if ($this->documentArray !== null && count($this->documentArray) > 1) {
$jsViewer = 'tx_dlf_viewer = [];';
$i = 0;
foreach ($this->documentArray as $document) {
Expand Down

0 comments on commit 32156a6

Please sign in to comment.