Fixed crash if response to login is malformed

This commit is contained in:
Alexander Corn 2016-04-04 21:42:46 -04:00
parent 9a3138aa35
commit fddd74cf24

View File

@ -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 );