Skip to content

Commit 12cd7dc

Browse files
author
vvo
committed
fix(menu): send an empty array values when no values
fixes #107
1 parent 31e4a80 commit 12cd7dc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

widgets/menu.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,10 @@ function toggleRefinement(helper, facetName, facetValue) {
6969
}
7070

7171
function getFacetValues(results, hierarchicalFacetName, sortBy, limit) {
72-
return results
73-
.getFacetValues(hierarchicalFacetName, {sortBy: sortBy})
74-
.data.slice(0, limit);
72+
var values = results
73+
.getFacetValues(hierarchicalFacetName, {sortBy: sortBy});
74+
75+
return values.data && values.data.slice(0, limit) || [];
7576
}
7677

7778
module.exports = menu;

0 commit comments

Comments
 (0)