From b919e45fc0455525822f1e316800a34db1b5e91f Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 27 May 2025 11:01:44 +0200 Subject: [PATCH] #7569 --- app/Fluidbook/Compiler/Compiler.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/Fluidbook/Compiler/Compiler.php b/app/Fluidbook/Compiler/Compiler.php index b769545b5..3496714b2 100644 --- a/app/Fluidbook/Compiler/Compiler.php +++ b/app/Fluidbook/Compiler/Compiler.php @@ -1774,11 +1774,14 @@ class Compiler extends Base implements CompilerInterface, IVirtualDirectoryError * @param $page * @return array */ - protected function getPageDimension($page) + protected function getPageDimension($page): ?array { $k = 'pagesDimensions.' . $page; if (!$this->config->has($k)) { $d = $this->getFluidbook()->getDocumentSize($page); + if (null === $d) { + return null; + } $res = [round($this->cssWidth, 2), round($d[1] * ($this->cssWidth / $d[0]), 2)]; $this->config->set($k, $res); return $res; @@ -1788,12 +1791,12 @@ class Compiler extends Base implements CompilerInterface, IVirtualDirectoryError public function getWidth($page = 1) { - return $this->getPageDimension($page)[0]; + return $this->getPageDimension($page)[0]??null; } public function getHeight($page = 1) { - return $this->getPageDimension($page)[1]; + return $this->getPageDimension($page)[1]??null; } -- 2.39.5