]> _ Git - fluidbook_tools.git/commitdiff
wip #7496 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 23 Apr 2025 17:00:37 +0000 (19:00 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 23 Apr 2025 17:00:37 +0000 (19:00 +0200)
src/Links/Link.php
src/Links/ZoomLink.php

index 95699e6ebb0e676c3dc834b1a0037f00c49ba870..57e57bad8a64b5dd0b00cec1a34c3896d2b073d6 100644 (file)
@@ -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;
index 6053158b4caa5bd07807dc993b9e24eee79e52dc..8345e4ff8ddbd4b5e6a804023bcd4544d5ed616a 100644 (file)
@@ -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'];