mirror of
https://github.com/DoctorMcKay/node-steamcommunity.git
synced 2026-08-19 13:13:28 +08:00
Fixed crash if response to login is malformed
This commit is contained in:
2
index.js
2
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 );
|
||||
|
||||
Reference in New Issue
Block a user