Skip to content

Commit ae7d867

Browse files
authored
fix: allow empty error events (#3082)
Some `ErrorEvent` implementations don't have a `.detail` field so null-guard on it before accessing properties.
1 parent b9e32cc commit ae7d867

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/libp2p/src/connection-manager/dial-queue.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export class DialQueue {
104104
})
105105
// a started job errored
106106
this.queue.addEventListener('error', (event) => {
107-
if (event.detail.name !== AbortError.name) {
107+
if (event.detail?.name !== AbortError.name) {
108108
this.log.error('error in dial queue - %e', event.detail)
109109
}
110110
})

0 commit comments

Comments
 (0)