Fixed crash no non-string 403 responses

https://dev.doctormckay.com/topic/845-responsebodymatch-is-not-a-function/
This commit is contained in:
Alexander Corn
2017-02-25 19:12:34 -05:00
parent 4542793175
commit a9b16cef1e

View File

@@ -98,7 +98,7 @@ SteamCommunity.prototype._checkHttpError = function(err, response, callback, bod
return err;
}
if (response.statusCode == 403 && response.body && response.body.match(/<div id="parental_notice_instructions">Enter your PIN below to exit Family View.<\/div>/)) {
if (response.statusCode == 403 && typeof response.body === 'string' && response.body.match(/<div id="parental_notice_instructions">Enter your PIN below to exit Family View.<\/div>/)) {
err = new Error("Family View Restricted");
callback(err, response, body);
return err;