Skip to content

Commit

Permalink
Guard against assets without URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
mmikkel committed Apr 6, 2024
1 parent b32be7d commit 878882f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/helpers/BunnyMateHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@ public static function bunnyPullUrl(string|Asset|null $pathOrAsset = '', ?string
return '';
}
if ($pathOrAsset instanceof Asset) {
$path = $pathOrAsset->getUrl();
$path = $pathOrAsset->getUrl() ?? '';
} else {
$path = $pathOrAsset;
}
if (empty($path)) {
return '';
}
return static::getPullZone($pullZoneHandle)
->getUrl($path);
}
Expand Down

0 comments on commit 878882f

Please sign in to comment.