Bug fix for undefined "suggestion.tag_name"
This commit is contained in:
Родитель
81af7662cc
Коммит
5ebbc58d6b
|
@ -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) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче