summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwinh <winnie@gitlab.com>2017-06-27 11:11:01 +0200
committerwinh <winnie@gitlab.com>2017-06-27 16:38:00 +0200
commita61eda78a7f7f7e52c4e2b9e3221cc1da37ccf9f (patch)
treeb8baa3dbec96231d5b649280774e8805169a975a
parentabfb59109d5b7ff874af9003980779d1a61a0064 (diff)
downloadgitlab-ce-a61eda78a7f7f7e52c4e2b9e3221cc1da37ccf9f.tar.gz
Add condition if there is a current user to DropdownUser
-rw-r--r--app/assets/javascripts/filtered_search/dropdown_user.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/assets/javascripts/filtered_search/dropdown_user.js b/app/assets/javascripts/filtered_search/dropdown_user.js
index 65c1b2050ac..1af791dba22 100644
--- a/app/assets/javascripts/filtered_search/dropdown_user.js
+++ b/app/assets/javascripts/filtered_search/dropdown_user.js
@@ -32,8 +32,11 @@ class DropdownUser extends gl.FilteredSearchDropdown {
}
hideCurrentUser() {
- const currenUserItem = this.dropdown.querySelector('.js-current-user');
- currenUserItem.classList.add('hidden');
+ const currentUserItem = this.dropdown.querySelector('.js-current-user');
+
+ if (currentUserItem) {
+ currentUserItem.classList.add('hidden');
+ }
}
itemClicked(e) {