Compare commits

...

6 Commits

Author SHA1 Message Date
Alexander Corn
f3cf2a4361 3.9.3 2015-09-20 00:33:32 -04:00
Alexander Corn
2890b70add Actually fixed the previous issue 2015-09-20 00:33:24 -04:00
Alexander Corn
1810727a2f 3.9.2 2015-09-19 23:35:10 -04:00
Alexander Corn
3d566ed0fb Return an error if we get invalid XML when getting a CSteamUser 2015-09-19 23:35:01 -04:00
Alexander Corn
80979bc387 3.9.1 2015-09-09 12:08:36 -04:00
Alexander Corn
4e326e3295 Always use Error objects in callbacks 2015-09-09 12:08:18 -04:00
3 changed files with 8 additions and 3 deletions

View File

@@ -40,6 +40,11 @@ SteamCommunity.prototype.getSteamUser = function(id, callback) {
customurl = match[1]; customurl = match[1];
} }
} }
if(!result.profile.steamID64 || !result.profile.onlineState) {
callback(new Error("No valid response"));
return;
}
callback(null, new CSteamUser(self, result.profile, customurl)); callback(null, new CSteamUser(self, result.profile, customurl));
}); });

View File

@@ -38,7 +38,7 @@ SteamCommunity.prototype.getInventoryHistory = function(options, callback) {
// Load the inventory item data // Load the inventory item data
var match2 = body.match(/var g_rgHistoryInventory = (.*);/); var match2 = body.match(/var g_rgHistoryInventory = (.*);/);
if(!match2) { if(!match2) {
callback("Malformed page: no trade found"); callback(new Error("Malformed page: no trade found"));
return; return;
} }
var historyInventory = JSON.parse(match2[1]); var historyInventory = JSON.parse(match2[1]);
@@ -132,7 +132,7 @@ function resolveVanityURL(vanityURL, callback) {
var match = body.match(/<steamID64>(\d+)<\/steamID64>/); var match = body.match(/<steamID64>(\d+)<\/steamID64>/);
if(!match || !match[1]) { if(!match || !match[1]) {
callback("Couldn't find Steam ID"); callback(new Error("Couldn't find Steam ID"));
return; return;
} }

View File

@@ -1,6 +1,6 @@
{ {
"name": "steamcommunity", "name": "steamcommunity",
"version": "3.9.0", "version": "3.9.3",
"description": "Provides an interface for logging into and interacting with the Steam Community website", "description": "Provides an interface for logging into and interacting with the Steam Community website",
"keywords": ["steam", "steam community"], "keywords": ["steam", "steam community"],
"homepage": "https://github.com/DoctorMcKay/node-steamcommunity", "homepage": "https://github.com/DoctorMcKay/node-steamcommunity",