diff --git a/index.js b/index.js index e95ced9..df51d81 100644 --- a/index.js +++ b/index.js @@ -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];