Skip to content

Commit bf36401

Browse files
committed
check if activeTunnel is available during close callback
1 parent 716341b commit bf36401

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/tunnel-launcher.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,13 @@ function run (options, callback) {
134134

135135
activeTunnel.close = closeCallback => {
136136
if (closeCallback) {
137-
activeTunnel.on('close', () => {
137+
if (!activeTunnel) {
138138
closeCallback()
139-
})
139+
} else {
140+
activeTunnel.on('close', () => {
141+
closeCallback()
142+
})
143+
}
140144
}
141145
activeTunnel.kill('SIGINT')
142146
}

0 commit comments

Comments
 (0)