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

Catch Promise.reject to avoid uncaught rejection

Oliver Günthera76aec12d419
diff --git a/frontend/src/app/components/wp-table/timeline/cells/wp-timeline-cell.ts b/frontend/src/app/components/wp-table/timeline/cells/wp-timeline-cell.ts
index 672ed14afdf..53536521aed 100644
--- a/frontend/src/app/components/wp-table/timeline/cells/wp-timeline-cell.ts
+++ b/frontend/src/app/components/wp-table/timeline/cells/wp-timeline-cell.ts
@@ -133,7 +133,7 @@ export class WorkPackageTimelineCell {
const cell = this.cellElement;
if (!cell.length) {
- return Promise.reject();
+ return Promise.reject('uninitialized');
}
const wasRendered = this.wpElement !== null && body.contains(this.wpElement);
@@ -190,17 +190,19 @@ export class WorkPackageTimelineCell {
const renderer = this.cellRenderer(renderInfo.workPackage);
// Render initial element if necessary
- this.lazyInit(renderer, renderInfo).then(() => {
- // Render the upgrade from renderInfo
- const shouldBeDisplayed = renderer.update(
- this.wpElement as HTMLDivElement,
- this.labels,
- renderInfo);
-
- if (!shouldBeDisplayed) {
- this.clear();
- }
- });
+ this.lazyInit(renderer, renderInfo)
+ .then(() => {
+ // Render the upgrade from renderInfo
+ const shouldBeDisplayed = renderer.update(
+ this.wpElement as HTMLDivElement,
+ this.labels,
+ renderInfo);
+
+ if (!shouldBeDisplayed) {
+ this.clear();
+ }
+ })
+ .catch(() => null);
}
}