Fixed double callbacks on some json errors (fixes #123)

This commit is contained in:
Alexander Corn 2016-08-10 18:55:23 -04:00
parent dd638df118
commit 17f51b9caa

View File

@ -60,10 +60,10 @@ SteamCommunity.prototype.httpRequest = function(uri, options, callback, source)
"jsonError": jsonError "jsonError": jsonError
}); });
if (hasCallback) { if (hasCallback && !(httpError || communityError || tradeError)) {
if (jsonError) { if (jsonError) {
callback.call(self, jsonError, response); callback.call(self, jsonError, response);
} else if (!(httpError || communityError || tradeError)) { } else {
callback.apply(self, arguments); callback.apply(self, arguments);
} }
} }