Compare commits

..

2 Commits

Author SHA1 Message Date
Alexander Corn
840e9548ed 3.19.0-beta5 2016-03-05 00:40:56 -05:00
Alexander Corn
dee6b7964b Fixed crash under specific conditions 2016-03-05 00:40:45 -05:00
2 changed files with 6 additions and 2 deletions

View File

@@ -97,7 +97,7 @@ SteamCommunity.prototype._checkHttpError = function(err, response, callback) {
};
SteamCommunity.prototype._checkCommunityError = function(html, callback) {
if(html.match(/<h1>Sorry!<\/h1>/)) {
if(html && html.match(/<h1>Sorry!<\/h1>/)) {
var match = html.match(/<h3>(.+)<\/h3>/);
var err = new Error(match ? match[1] : "Unknown error occurred");
callback(err);
@@ -108,6 +108,10 @@ SteamCommunity.prototype._checkCommunityError = function(html, callback) {
};
SteamCommunity.prototype._checkTradeError = function(html, callback) {
if (!html) {
return false;
}
var match = html.match(/<div id="error_msg">\s*([^<]+)\s*<\/div>/);
if (match) {
var err = new Error(match[1].trim());

View File

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