File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff 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 ( ) ;
You can’t perform that action at this time.
0 commit comments