Skip to content

Commit

Permalink
Tolerate no page context
Browse files Browse the repository at this point in the history
  • Loading branch information
richardhj authored Feb 9, 2022
1 parent d76c87a commit 285cdc8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Encore/EncoreEntrypointLookupCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ public function getEntrypointLookup(string $buildName = null): EntrypointLookupI
{
if (null === $buildName || '_default' === $buildName) {
/** @var PageModel $pageModel */
$pageModel = $GLOBALS['objPage'];

$buildName = $pageModel->theme;
if (null !== $pageModel = $GLOBALS['objPage'] ?? null) {
$buildName = $pageModel->theme;
}
}

$themePath = Path::join($this->webDir, 'themes', $buildName, 'entrypoints.json');
Expand Down

0 comments on commit 285cdc8

Please sign in to comment.