Skip to content

Commit

Permalink
conditional check for linkPic
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmparrish committed Sep 19, 2024
1 parent adf2a9c commit 66d094b
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 @@ -47,8 +47,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 54 in libs/utils/decorate.js

View check run for this annotation

Codecov / codecov/patch

libs/utils/decorate.js#L52-L54

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

Expand Down

0 comments on commit 66d094b

Please sign in to comment.