Skip to content

Commit ca507c3

Browse files
authored
Merge pull request #646 from pykettk/patch-1
Handle NULL Image URLs in Pixel Ratio Plugin
2 parents 122a8be + 1924423 commit ca507c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Plugin/AdaptivePixelRatioPlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function beforeToHtml(Image $subject)
6868
$srcSet = [];
6969
$imageUrl = $subject->getData('image_url');
7070
$pixelRatiosArray = $this->config->getImageOptimizationRatios();
71-
$glue = (strpos($imageUrl, '?') !== false) ? '&' : '?';
71+
$glue = (strpos($imageUrl ?? '', '?') !== false) ? '&' : '?';
7272

7373
# Pixel ratios defaults are based on the table from https://mydevice.io/devices/
7474
# Bulk of devices are 2x however many new devices like Samsung S8, iPhone X etc are 3x and 4x

0 commit comments

Comments
 (0)