Skip to content

Commit

Permalink
safer call to client request
Browse files Browse the repository at this point in the history
  • Loading branch information
bojand committed Dec 28, 2016
1 parent 5f81931 commit 821d9ac
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ Builder.prototype.buildAction = function (action) {
}

this.client = this.base;
return this.client.request(action.method, requestPath, data, fn);
if (fn) {
return this.client.request(action.method, requestPath, data, fn);
} else {
return this.client.request(action.method, requestPath, data);
}
}

constructor.prototype[getName(actionName)] = function (data, fn) {
Expand Down

0 comments on commit 821d9ac

Please sign in to comment.