Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Fix errors on uninitialized dropdown

Oliver Günthera45fc9056c04
diff --git a/frontend/src/app/components/projects/project-menu-autocomplete/project-menu-autocomplete.component.ts b/frontend/src/app/components/projects/project-menu-autocomplete/project-menu-autocomplete.component.ts
index 8f70b22418d..4baf8415707 100644
--- a/frontend/src/app/components/projects/project-menu-autocomplete/project-menu-autocomplete.component.ts
+++ b/frontend/src/app/components/projects/project-menu-autocomplete/project-menu-autocomplete.component.ts
@@ -97,7 +97,11 @@ export class ProjectMenuAutocompleteComponent extends ILazyAutocompleterBridge<I
}
public close() {
- (this.input as any).projectMenuAutocomplete('destroy');
+ try {
+ (this.input as any).projectMenuAutocomplete('destroy');
+ } catch(e) {
+ console.warn("Failed to destroy autocomplete: %O", e);
+ }
this.$element.find('.project-search-results').css('visibility', 'hidden');
}