From fddd74cf243f74e551c2631f3b41fe366bfb26ef Mon Sep 17 00:00:00 2001 From: Alexander Corn Date: Mon, 4 Apr 2016 21:42:46 -0400 Subject: [PATCH] Fixed crash if response to login is malformed --- index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.js b/index.js index 8ae4af8..8695d18 100644 --- a/index.js +++ b/index.js @@ -135,6 +135,8 @@ SteamCommunity.prototype.login = function(details, callback) { callback(error); } else if(!body.success) { callback(new Error(body.message || "Unknown error")); + } else if(!body.oauth) { + callback(new Error("Malformed response")); } else { var sessionID = generateSessionID(); var oAuth = JSON.parse( body.oauth );