Skip to content

Commit

Permalink
fix: prevent division by zero error
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphjsmit committed Jun 15, 2024
1 parent 17a6d00 commit 1bd284e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Tags/TwitterCardTags.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static function initialize(SEOData $SEOData): ?static
$collection = new static();

// No generic image that spans multiple pages
if ($SEOData->image && $SEOData->image !== secure_url(config('seo.image.fallback')) && $SEOData->imageMeta) {
if ($SEOData->image && $SEOData->image !== secure_url(config('seo.image.fallback')) && $SEOData->imageMeta?->height > 0) {
// Only one Twitter card can be pushed. The `summary_large_image` card
// is tried first, then it falls back to the normal `summary` card.
$imageMetaWidthDividedByHeight = $SEOData->imageMeta->width / $SEOData->imageMeta->height;
Expand Down

0 comments on commit 1bd284e

Please sign in to comment.