Skip to content

Commit 285cdc8

Browse files
authored
Tolerate no page context
1 parent d76c87a commit 285cdc8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Encore/EncoreEntrypointLookupCollection.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ public function getEntrypointLookup(string $buildName = null): EntrypointLookupI
4444
{
4545
if (null === $buildName || '_default' === $buildName) {
4646
/** @var PageModel $pageModel */
47-
$pageModel = $GLOBALS['objPage'];
48-
49-
$buildName = $pageModel->theme;
47+
if (null !== $pageModel = $GLOBALS['objPage'] ?? null) {
48+
$buildName = $pageModel->theme;
49+
}
5050
}
5151

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

0 commit comments

Comments
 (0)