From 3d566ed0fb7aae948a97777e67226ef0bb7de3a6 Mon Sep 17 00:00:00 2001 From: Alexander Corn Date: Sat, 19 Sep 2015 23:35:01 -0400 Subject: [PATCH] Return an error if we get invalid XML when getting a CSteamUser --- classes/CSteamUser.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/classes/CSteamUser.js b/classes/CSteamUser.js index c382f44..046acfa 100644 --- a/classes/CSteamUser.js +++ b/classes/CSteamUser.js @@ -40,6 +40,10 @@ SteamCommunity.prototype.getSteamUser = function(id, callback) { customurl = match[1]; } } + + if(!result.profile.steamID64 || !result.profile.onlineState) { + callback(new Error("No valid response")); + } callback(null, new CSteamUser(self, result.profile, customurl)); });