From: Vincent Vanwaelscappel Date: Wed, 23 Apr 2025 17:00:37 +0000 (+0200) Subject: wip #7496 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=618140e31df00c9fb75fa71af6e5e172856d6f70;p=fluidbook_tools.git wip #7496 @0.25 --- diff --git a/src/Links/Link.php b/src/Links/Link.php index 95699e6..57e57ba 100644 --- a/src/Links/Link.php +++ b/src/Links/Link.php @@ -1069,6 +1069,9 @@ class Link $res = Cache::rememberForever('qrcode_' . hash('sha256', $toscan), function () use ($toscan) { try { + if (null === $toscan) { + return ''; + } $result = (new QRCode)->readFromFile($toscan); $stringRes = (string)$result; return $stringRes; diff --git a/src/Links/ZoomLink.php b/src/Links/ZoomLink.php index 6053158..8345e4f 100644 --- a/src/Links/ZoomLink.php +++ b/src/Links/ZoomLink.php @@ -146,6 +146,10 @@ class ZoomLink extends NormalLink if (!isset($attributes['pdf']) || !$attributes['pdf']) { $pdfpath = $compiler->getPagePDFSource($attributes['page']); + if(!$pdfpath){ + $compiler->addIssue(16, ['error' => 'The zoom area can\'t be generated', 'uid' => $attributes['id'], 'page' => $attributes['page']]); + return null; + } $extractPage = 1; } else { $pdfpath = $attributes['pdf'];