Catch Promise.reject to avoid uncaught rejection

[ci skip]
pull/8055/head
Oliver Günther 5 years ago
parent ded0eed2f8
commit a76aec12d4
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 26
      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);
}
}

Loading…
Cancel
Save