Skip to content

Commit

Permalink
Fix(request): Return void on httpRequest() (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
fvdm committed Aug 22, 2016
1 parent 3793b82 commit a957b41
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,16 @@ app.httpRequest = function httpRequest (props, callback) {
};

if (!app.config.endpoint || !app.config.endpoint.match (/^https?:\/\/[\w\d\.]+/)) {
return app.doError ('endpoint missing', null, null, callback);
app.doError ('endpoint missing', null, null, callback);
return;
}

// we need but don't have an accessToken
if (!props.noauth && !app.config.accessToken) {
app.oauth.getTokenFromPassword (function (err, token) {
if (err) {
return callback (err);
callback (err);
return;
}

app.config.accessToken = token.access_token;
Expand Down Expand Up @@ -184,7 +186,7 @@ app.httpRequest = function httpRequest (props, callback) {
options.headers ['User-Agent'] = 'node/toonapi (https://github.com/fvdm/nodejs-toonapi)';
httpreq.doRequest (options, doResponse);

return null;
return;
};


Expand Down

0 comments on commit a957b41

Please sign in to comment.