Skip to content

Commit aeadc1b

Browse files
Alan Shawjacobheun
Alan Shaw
authored andcommitted
fix: missing queue (libp2p#323)
1 parent 9592c22 commit aeadc1b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/dialer/queueManager.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ const { DIAL_ABORTED } = require('../errors')
66
const nextTick = require('async/nextTick')
77
const retimer = require('retimer')
88
const { QUARTER_HOUR } = require('../constants')
9+
const debug = require('debug')
10+
const log = debug('libp2p:switch:dial:manager')
911
const noop = () => {}
1012

1113
class DialQueueManager {
@@ -154,6 +156,12 @@ class DialQueueManager {
154156
}
155157

156158
let targetQueue = this._queues[nextQueue.value]
159+
160+
if (!targetQueue) {
161+
log('missing queue %s, maybe it was aborted?', nextQueue.value)
162+
return
163+
}
164+
157165
this._dialingQueues.add(targetQueue.id)
158166
targetQueue.start()
159167
}

0 commit comments

Comments
 (0)