From 17f51b9caac38a1ef0214f00e5180ece6d42bbfe Mon Sep 17 00:00:00 2001 From: Alexander Corn Date: Wed, 10 Aug 2016 18:55:23 -0400 Subject: [PATCH] Fixed double callbacks on some json errors (fixes #123) --- components/http.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/http.js b/components/http.js index c504b91..f5c0a3b 100644 --- a/components/http.js +++ b/components/http.js @@ -60,10 +60,10 @@ SteamCommunity.prototype.httpRequest = function(uri, options, callback, source) "jsonError": jsonError }); - if (hasCallback) { + if (hasCallback && !(httpError || communityError || tradeError)) { if (jsonError) { callback.call(self, jsonError, response); - } else if (!(httpError || communityError || tradeError)) { + } else { callback.apply(self, arguments); } }