Browse Source

fix(perf): Fix registerCallback being called on null (#33421)

Missed this check since any cast was needed to get at unexposed ts
Kev 2 years ago
parent
commit
0d7f7aad6e
1 changed files with 5 additions and 1 deletions
  1. 5 1
      static/app/utils/performanceForSentry.tsx

+ 5 - 1
static/app/utils/performanceForSentry.tsx

@@ -66,7 +66,11 @@ class LongTaskObserver {
           });
         });
       });
-      transaction.registerBeforeFinishCallback(t => {
+
+      if (!transaction) {
+        return null;
+      }
+      transaction?.registerBeforeFinishCallback?.(t => {
         if (!browserPerformanceTimeOrigin) {
           return;
         }