Skip to content

Commit 31ea527

Browse files
committed
added default callbacks if not specified
1 parent 84ade59 commit 31ea527

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/Local.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ function Local(){
1818
this.doneRegex = /Press Ctrl-C to exit/i;
1919

2020
this.start = function(options, callback){
21+
if(typeof callback !== 'function')
22+
callback = function(){};
23+
2124
this.userArgs = [];
2225
var that = this;
2326
this.addArgs(options);
@@ -104,6 +107,9 @@ function Local(){
104107
};
105108

106109
this.stop = function (callback) {
110+
if(typeof callback !== 'function')
111+
callback = function(){};
112+
107113
if(!this.pid) return callback();
108114
this.opcode = 'stop';
109115
this.tunnel = childProcess.execFile(this.binaryPath, this.getBinaryArgs(), function(error){

0 commit comments

Comments
 (0)