Skip to content

Commit f11d97b

Browse files
committed
fix replay
1 parent de56e04 commit f11d97b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/replay/src/replay.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -802,13 +802,19 @@ export class ReplayContainer implements ReplayContainerInterface {
802802

803803
await this._addPerformanceEntries();
804804

805-
if (!this.eventBuffer.pendingLength) {
805+
// Check eventBuffer again, as it could have been stopped in the meanwhile
806+
if (!this.eventBuffer || !this.eventBuffer.pendingLength) {
806807
return;
807808
}
808809

809810
// Only attach memory event if eventBuffer is not empty
810811
await addMemoryEntry(this);
811812

813+
// Check eventBuffer again, as it could have been stopped in the meanwhile
814+
if (!this.eventBuffer) {
815+
return;
816+
}
817+
812818
try {
813819
// Note this empties the event buffer regardless of outcome of sending replay
814820
const recordingData = await this.eventBuffer.finish();

0 commit comments

Comments
 (0)