diff --git a/code/FocusPointImage.php b/code/FocusPointImage.php index 84363ac..0b679da 100755 --- a/code/FocusPointImage.php +++ b/code/FocusPointImage.php @@ -294,6 +294,10 @@ public function CroppedFocusedImage($width, $height, $upscale = true) return $this->owner; } elseif ($cropData = $this->calculateCrop($width, $height)) { $img = $this->owner->getFormattedImage('CroppedFocusedImage', $width, $height, $cropData['CropAxis'], $cropData['CropOffset']); + if (!$img) { + return null; + } + // Update FocusPoint $img->FocusX = $cropData['x']['FocusPoint']; $img->FocusY = $cropData['y']['FocusPoint'];