summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorTim Zallmann <tzallmann@gitlab.com>2019-01-18 09:51:07 +0100
committerTim Zallmann <tzallmann@gitlab.com>2019-01-18 09:51:07 +0100
commit8edfbe3d8de3a7cbae28f5295f3f03287c3599cf (patch)
tree9fc81aa40f4beb99d36b0fa695081db78de886da /app
parent07f6c1b8741b6968bc278db855af4883ad68a31d (diff)
downloadgitlab-ce-8edfbe3d8de3a7cbae28f5295f3f03287c3599cf.tar.gz
Fixed problem when element in main menu is not there (specs)
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/frequent_items/components/app.vue3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/assets/javascripts/frequent_items/components/app.vue b/app/assets/javascripts/frequent_items/components/app.vue
index 3b8f7ca9e07..968e255e1fc 100644
--- a/app/assets/javascripts/frequent_items/components/app.vue
+++ b/app/assets/javascripts/frequent_items/components/app.vue
@@ -49,7 +49,8 @@ export default {
eventHub.$on(`${this.namespace}-dropdownOpen`, this.dropdownOpenHandler);
// As we init it through requestIdleCallback it could be that the dropdown is already open
- if (document.getElementById(`nav-${this.namespace}-dropdown`).classList.contains('show')) {
+ const namespaceDropdown = document.getElementById(`nav-${this.namespace}-dropdown`);
+ if (namespaceDropdown && namespaceDropdown.classList.contains('show')) {
this.dropdownOpenHandler();
}
},