Fixed errors not being handled in getTradeURL

This commit is contained in:
Alex Corn
2017-11-30 08:59:49 -05:00
parent b45e8d97ed
commit 8eab34bf18

View File

@@ -372,6 +372,11 @@ SteamCommunity.prototype.loggedIn = function(callback) {
SteamCommunity.prototype.getTradeURL = function(callback) {
this._myProfile("/tradeoffers/privacy", null, (err, response, body) => {
if (err) {
callback(err);
return;
}
var match = body.match(/https?:\/\/(www.)?steamcommunity.com\/tradeoffer\/new\/?\?partner=\d+(&|&)token=([a-zA-Z0-9-_]+)/);
if (match) {
var token = match[3];