Skip to content

Commit

Permalink
Add null check for product recommendation image (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
herzog31 authored Nov 27, 2024
1 parent 6cc6c93 commit 1082959
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion blocks/product-recommendations/product-recommendations.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ function renderPlaceholder(block) {

function renderItem(unitId, product) {
let image = product.images[0]?.url;
image = image.replace('http://', '//');
if (image) {
image = image.replace('http://', '//');
}

const clickHandler = () => {
window.adobeDataLayer.push((dl) => {
Expand Down

0 comments on commit 1082959

Please sign in to comment.