From 00b89f71b3a67f0222bfb85a620a9e65e3045cb3 Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Fri, 13 Mar 2020 13:05:34 -0400 Subject: [PATCH] Prevent an exception from getting thrown in one part of Pageimage where it's preferable for the error not to be fatal --- wire/core/Pageimage.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wire/core/Pageimage.php b/wire/core/Pageimage.php index 31c76ba5..068e878e 100644 --- a/wire/core/Pageimage.php +++ b/wire/core/Pageimage.php @@ -1659,9 +1659,13 @@ class Pageimage extends Pagefile { $height = 0; } $options['webpAdd'] = true; - $original->size($width, $height, $options); - $error = $this->error; + try { + $original->size($width, $height, $options); + } catch(\Exception $e) { + $this->error = ($this->error ? "$this->error - " : "") . $e->getMessage(); + } + $error = $this->error; $event->return = empty($error); }