Skip to content

Commit

Permalink
MWPW-155984 - Brick list showing null value in link label (#2921)
Browse files Browse the repository at this point in the history
conditional check for linkPic
  • Loading branch information
ryanmparrish committed Sep 24, 2024
1 parent 3557dd6 commit 58b3850
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions libs/utils/decorate.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,11 @@ export function decorateIconStack(el) {
const picIndex = links[0].querySelector('a picture') ? 0 : 1;
const linkImg = links[picIndex];
const linkText = links[1 - picIndex];
linkText.prepend(linkImg.querySelector('picture'));
linkImg.remove();
const linkPic = linkImg.querySelector('picture');
if (linkPic) {
linkText.prepend(linkPic);
linkImg.remove();
}

Check warning on line 56 in libs/utils/decorate.js

View check run for this annotation

Codecov / codecov/patch

libs/utils/decorate.js#L54-L56

Added lines #L54 - L56 were not covered by tests
});
}

Expand Down

0 comments on commit 58b3850

Please sign in to comment.