Skip to content

Commit 61bc05f

Browse files
authored
add check if color object is defined for adaptive images (#1135)
1 parent 697ce35 commit 61bc05f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

view/frontend/web/internals/common.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,14 @@ requirejs(['algoliaBundle'], function(algoliaBundle) {
9898
var colors = [];
9999

100100
$.each(hit._highlightResult.color, function (i, color) {
101-
if (color.matchLevel === 'none') {
101+
if (color.matchLevel === undefined || color.matchLevel === 'none') {
102102
return;
103103
}
104104

105105
colors.push(color.value);
106106

107107
if (algoliaConfig.useAdaptiveImage === true) {
108108
var matchedColor = color.matchedWords.join(' ');
109-
110109
if (hit.images_data && color.fullyHighlighted && color.fullyHighlighted === true) {
111110
matchedColors.push(matchedColor);
112111
}

0 commit comments

Comments
 (0)