Skip to content

Commit

Permalink
fix fetch with coverage enabled (#2330)
Browse files Browse the repository at this point in the history
  • Loading branch information
KhafraDev authored Oct 11, 2023
1 parent 882ff6d commit 3a9f481
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/compat/dispatcher-weakref.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ class CompatFinalizer {
}

register (dispatcher, key) {
dispatcher.on('disconnect', () => {
if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) {
this.finalizer(key)
}
})
if (dispatcher.on) {
dispatcher.on('disconnect', () => {
if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) {
this.finalizer(key)
}
})
}
}
}

Expand Down

0 comments on commit 3a9f481

Please sign in to comment.