Skip to content

Commit 793a83c

Browse files
committed
fix(agent): callback err
1 parent e4cc0a6 commit 793a83c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/agent/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ Agent.prototype.stop = function (callback) {
124124
}
125125

126126
if (counter >= agents.length) {
127-
callback(error)
127+
if (callback && typeof callback === 'function') {
128+
callback(error)
129+
}
128130
} else {
129131
counter++
130132
}

0 commit comments

Comments
 (0)