Skip to content

Commit c2bd2d9

Browse files
wilrjonom
authored andcommitted
fix: handle case if failover returns null
1 parent 9916133 commit c2bd2d9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Extensions/FocusPointDBFileExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function getFocusPoint(): ?DBFocusPoint
2727
// using a non-focuspoint resize mechanism.
2828
/** @var ViewableData|FocusPointExtension $failover */
2929
$failover = $this->owner->getFailover();
30-
if ($failover->hasExtension(FocusPointExtension::class)) {
30+
if ($failover && $failover->hasExtension(FocusPointExtension::class)) {
3131
$sourceFocus = $failover->FocusPoint;
3232

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

40-
// Save this focu point and return
40+
// Save this focus point and return
4141
$this->owner->setFocusPoint($newFocusPoint);
4242
return $newFocusPoint;
4343
}

0 commit comments

Comments
 (0)