Skip to content

Commit

Permalink
fix: handle case if failover returns null
Browse files Browse the repository at this point in the history
  • Loading branch information
wilr authored and jonom committed Oct 27, 2022
1 parent 9916133 commit c2bd2d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Extensions/FocusPointDBFileExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function getFocusPoint(): ?DBFocusPoint
// using a non-focuspoint resize mechanism.
/** @var ViewableData|FocusPointExtension $failover */
$failover = $this->owner->getFailover();
if ($failover->hasExtension(FocusPointExtension::class)) {
if ($failover && $failover->hasExtension(FocusPointExtension::class)) {
$sourceFocus = $failover->FocusPoint;

// Note: Let Width / Height be lazy loaded, so don't generate here
Expand All @@ -37,7 +37,7 @@ public function getFocusPoint(): ?DBFocusPoint
'Y' => $sourceFocus->getY(),
], $this->owner);

// Save this focu point and return
// Save this focus point and return
$this->owner->setFocusPoint($newFocusPoint);
return $newFocusPoint;
}
Expand Down

0 comments on commit c2bd2d9

Please sign in to comment.