Skip to content

Commit

Permalink
fix(PageService): Don't run getFullWidth() on null page
Browse files Browse the repository at this point in the history
Fixes: #1431

Signed-off-by: Jonas <[email protected]>
  • Loading branch information
mejo- committed Aug 21, 2024
1 parent 3f58de4 commit e955298
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Service/PageService.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ private function getPageByFile(File $file, ?Node $parent = null): PageInfo {
$lastUserId = ($page !== null) ? $page->getLastUserId() : null;
$emoji = ($page !== null) ? $page->getEmoji() : null;
$subpageOrder = ($page !== null) ? $page->getSubpageOrder() : null;
$fullWidth = ($page !== null) ? $page->getFullWidth() : false;
$fullWidth = $page !== null && $page->getFullWidth();
$pageInfo = new PageInfo();
try {
$pageInfo->fromFile($file,
Expand Down Expand Up @@ -236,7 +236,7 @@ private function getTrashPageByFile(File $file, string $filename, string $timest
$lastUserId ? $this->userManager->getDisplayName($lastUserId) : null,
$emoji,
$subpageOrder,
$page->getFullWidth());
$page?->getFullWidth());
$pageInfo->setTrashTimestamp($trashTimestamp);
$pageInfo->setFilePath('');
$pageInfo->setTitle(basename($filename, PageInfo::SUFFIX));
Expand Down

0 comments on commit e955298

Please sign in to comment.