Skip to content

Commit 8095f38

Browse files
committed
fix replay
1 parent 973d090 commit 8095f38

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
@@ -803,13 +803,19 @@ export class ReplayContainer implements ReplayContainerInterface {
803803

804804
await this._addPerformanceEntries();
805805

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

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

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

0 commit comments

Comments
 (0)