From dee52bf7e218d745cd1bb5717a24351aa7d2d222 Mon Sep 17 00:00:00 2001 From: Alexander Corn Date: Wed, 29 Jul 2015 22:22:43 -0400 Subject: [PATCH] Fixed crashes when using various class methods --- classes/CMarketItem.js | 2 +- classes/CMarketSearchResult.js | 3 ++- classes/CSteamGroup.js | 2 +- classes/CSteamUser.js | 8 ++++---- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/classes/CMarketItem.js b/classes/CMarketItem.js index dd90d5f..cd14194 100644 --- a/classes/CMarketItem.js +++ b/classes/CMarketItem.js @@ -92,7 +92,7 @@ CMarketItem.prototype.updatePrice = function(callback) { "uri": "https://steamcommunity.com/market/itemordershistogram?country=US&language=english¤cy=1&item_nameid=" + this.commodityID, "json": true, }, function(err, response, body) { - if(self._checkHttpError(err, response, callback)) { + if(self._community._checkHttpError(err, response, callback)) { return; } diff --git a/classes/CMarketSearchResult.js b/classes/CMarketSearchResult.js index 190c502..8e6aca5 100644 --- a/classes/CMarketSearchResult.js +++ b/classes/CMarketSearchResult.js @@ -27,10 +27,11 @@ SteamCommunity.prototype.marketSearch = function(options, callback) { qs.count = 100; qs.sort_column = 'price'; qs.sort_dir = 'asc'; - performSearch(this.request, qs, [], callback); + performSearch.call(this, this.request, qs, [], callback); }; function performSearch(request, qs, results, callback) { + var self = this; request({ "uri": "https://steamcommunity.com/market/search/render/", "qs": qs, diff --git a/classes/CSteamGroup.js b/classes/CSteamGroup.js index f285f9e..112ec24 100644 --- a/classes/CSteamGroup.js +++ b/classes/CSteamGroup.js @@ -65,7 +65,7 @@ CSteamGroup.prototype.getMembers = function(callback, members, link) { var self = this; this._community.request(link, function(err, response, body) { - if(self._checkHttpError(err, response, callback)) { + if(self._community._checkHttpError(err, response, callback)) { return; } diff --git a/classes/CSteamUser.js b/classes/CSteamUser.js index 79255ef..b54dda7 100644 --- a/classes/CSteamUser.js +++ b/classes/CSteamUser.js @@ -112,7 +112,7 @@ CSteamUser.prototype.addFriend = function(callback) { return; } - if(self._checkHttpError(err, response, callback)) { + if(self._community._checkHttpError(err, response, callback)) { return; } @@ -138,7 +138,7 @@ CSteamUser.prototype.acceptFriendRequest = function(callback) { return; } - if(self._checkHttpError(err, response, callback)) { + if(self._community._checkHttpError(err, response, callback)) { return; } @@ -152,7 +152,7 @@ CSteamUser.prototype.removeFriend = function(callback) { return; } - if(self._checkHttpError(err, response, callback)) { + if(self._community._checkHttpError(err, response, callback)) { return; } @@ -166,7 +166,7 @@ CSteamUser.prototype.blockCommunication = function(callback) { return; } - if(self._checkHttpError(err, response, callback)) { + if(self._community._checkHttpError(err, response, callback)) { return; }