Bug fix for undefined "suggestion.tag_name"

This commit is contained in:
Pete Gonzalez 2020-07-20 18:26:59 -07:00
Родитель 81af7662cc
Коммит 5ebbc58d6b
2 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -13,7 +13,7 @@ autocomplete('#search-input', { hint: false }, [
resultHeading = suggestion.title;
}
else {
if (suggestion.tag_name[0] !== 'h') {
if ((!suggestion.tag_name) || suggestion.tag_name[0] !== 'h') {
// If the suggestion did not match a heading, then we can use the heading
// from the hierarchy
if (suggestion.hierarchy) {

Просмотреть файл

@ -21,7 +21,7 @@ autocomplete('#search-input', { hint: false }, [
} else if (suggestion.title) {
resultHeading = suggestion.title;
} else {
if (suggestion.tag_name[0] !== 'h') {
if ((!suggestion.tag_name) || suggestion.tag_name[0] !== 'h') {
// If the suggestion did not match a heading, then we can use the heading
// from the hierarchy
if (suggestion.hierarchy) {