Skip to content

Commit

Permalink
Fixed errors not being handled in getTradeURL
Browse files Browse the repository at this point in the history
  • Loading branch information
DoctorMcKay committed Nov 30, 2017
1 parent b45e8d9 commit 8eab34b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 8eab34b

Please sign in to comment.