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

Accept that last render state can be null

Oliver Günther548ca3c29401
diff --git a/frontend/src/app/components/wp-table/timeline/cells/timeline-cell-renderer.ts b/frontend/src/app/components/wp-table/timeline/cells/timeline-cell-renderer.ts
index ca815ff6725..3eec14036b2 100644
--- a/frontend/src/app/components/wp-table/timeline/cells/timeline-cell-renderer.ts
+++ b/frontend/src/app/components/wp-table/timeline/cells/timeline-cell-renderer.ts
@@ -466,7 +466,11 @@ export class TimelineCellRenderer {
return false;
}
- const renderPass = this.workPackageTimeline.workPackageTable.lastRenderPass! as HierarchyRenderPass;
- return !!renderPass.parentsWithVisibleChildren[wp.id!];
+ const renderPass = this.workPackageTimeline.workPackageTable.lastRenderPass as HierarchyRenderPass|null;
+ if (renderPass) {
+ return !!renderPass.parentsWithVisibleChildren[wp.id!];
+ }
+
+ return false;
}
}
diff --git a/frontend/src/app/sentry/sentry-reporter.ts b/frontend/src/app/sentry/sentry-reporter.ts
index bd9338667ea..0bd95658d0d 100644
--- a/frontend/src/app/sentry/sentry-reporter.ts
+++ b/frontend/src/app/sentry/sentry-reporter.ts
@@ -28,8 +28,8 @@
import {Scope} from "@sentry/hub";
import {Severity} from "@sentry/types";
+import {Event as SentryEvent} from "@sentry/types";
import {environment} from "../../environments/environment";
-import {debugLog} from "core-app/helpers/debug_output";
export type ScopeCallback = (scope:Scope) => void;
@@ -70,12 +70,6 @@ export class SentryReporter implements ErrorReporter {
private client:any;
constructor() {
- const unsupportedBrowser = document.body.classList.contains('-unsupported-browser');
- if (unsupportedBrowser) {
- console.warn("Browser is not supported, skipping sentry reporting completely.")
- return;
- }
-
const sentryElement = document.querySelector('meta[name=openproject_sentry]') as HTMLElement|null;
if (sentryElement) {
import('@sentry/browser').then((Sentry) => {
@@ -87,7 +81,8 @@ export class SentryReporter implements ErrorReporter {
'The transition has been superseded by a different transition',
// Uncaught error resource promises
'Uncaught (in promise): [ErrorResource'
- ]
+ ],
+ beforeSend: (event) => this.filterEvent(event)
});
this.sentryLoaded(Sentry);
@@ -169,4 +164,20 @@ export class SentryReporter implements ErrorReporter {
/** Execute callbacks */
this.contextCallbacks.forEach(cb => cb(scope));
}
+
+ /**
+ * Filters the event content's or removes
+ * it from being sent.
+ *
+ * @param event
+ */
+ private filterEvent(event:SentryEvent):SentryEvent|null {
+ const unsupportedBrowser = document.body.classList.contains('-unsupported-browser');
+ if (unsupportedBrowser) {
+ console.warn("Browser is not supported, skipping sentry reporting completely.")
+ return null;
+ }
+
+ return event;
+ }
}
\ No newline at end of file