Commit 18296bf1 authored by Clement Ho's avatar Clement Ho

Merge branch '49861-top-nav-search-bar-produces-console-error-when-unauthenticated' into 'master'

Resolve "Top nav search bar produces console error when unauthenticated"

Closes #49861

See merge request gitlab-org/gitlab-ce!20970
parents bed7ff8e 52e5250b
......@@ -137,7 +137,11 @@ export default class SearchAutocomplete {
if (!term) {
const contents = this.getCategoryContents();
if (contents) {
this.searchInput.data('glDropdown').filter.options.callback(contents);
const glDropdownInstance = this.searchInput.data('glDropdown');
if (glDropdownInstance) {
glDropdownInstance.filter.options.callback(contents);
}
this.enableAutocomplete();
}
return;
......
---
title: fix error caused when using the search bar while unauthenticated
merge_request: 20970
author:
type: fixed
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment