Skip to content

Commit 2b5b396

Browse files
committed
Fine tune results variable #775
1 parent 8f68fca commit 2b5b396

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/components/search-input/dropdown.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,14 @@ export default class Dropdown extends Component {
3434
* }
3535
* }
3636
*/
37+
3738
get _groupedResults() {
38-
if (!get(this, 'results.length')) {
39+
let results = this.results || [];
40+
if (!results.length) {
3941
return {};
4042
}
4143

42-
const lvl0Group = this.results.reduce((previous, current) => {
44+
const lvl0Group = results.reduce((previous, current) => {
4345
// Remap all lowercase usages of 'guides' to 'Guides'
4446
let lvl0 = get(current, 'hierarchy.lvl0');
4547
// If lvl0 doesn't exist in the resulting object, create the array

0 commit comments

Comments
 (0)