Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Fix JavaScript crash which I have seen happen with 0.17.13
Browse files Browse the repository at this point in the history
Auditors: @NejcZdovc
  • Loading branch information
bsclifton committed Jul 3, 2017
1 parent 70f499e commit 97adc1e
Showing 1 changed file with 29 additions and 27 deletions.
56 changes: 29 additions & 27 deletions app/common/lib/suggestion.js
Original file line number Diff line number Diff line change
Expand Up @@ -646,33 +646,35 @@ const filterSuggestionListByType = (suggestionList) => {
const searchSuggestions = []
const topSiteSuggestions = []

suggestionList.forEach(item => {
switch (item.get('type')) {
case suggestionTypes.BOOKMARK:
bookmarkSuggestions.push(item)
break

case suggestionTypes.HISTORY:
historySuggestions.push(item)
break

case suggestionTypes.ABOUT_PAGES:
aboutPagesSuggestions.push(item)
break

case suggestionTypes.TAB:
tabSuggestions.push(item)
break

case suggestionTypes.SEARCH:
searchSuggestions.push(item)
break

case suggestionTypes.TOP_SITE:
topSiteSuggestions.push(item)
break
}
})
if (suggestionList) {
suggestionList.forEach(item => {
switch (item.get('type')) {
case suggestionTypes.BOOKMARK:
bookmarkSuggestions.push(item)
break

case suggestionTypes.HISTORY:
historySuggestions.push(item)
break

case suggestionTypes.ABOUT_PAGES:
aboutPagesSuggestions.push(item)
break

case suggestionTypes.TAB:
tabSuggestions.push(item)
break

case suggestionTypes.SEARCH:
searchSuggestions.push(item)
break

case suggestionTypes.TOP_SITE:
topSiteSuggestions.push(item)
break
}
})
}

return {
bookmarkSuggestions,
Expand Down

0 comments on commit 97adc1e

Please sign in to comment.