Skip to content

Commit

Permalink
Merge pull request #72 from mediocre/usps-bad-response
Browse files Browse the repository at this point in the history
Error out if neither TrackResponse or Error are returned (invalid xml or garbage response)
  • Loading branch information
javamatte committed Jun 1, 2023
2 parents c400f2b + ecabd95 commit a91dac0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion carriers/usps.js
Expand Up @@ -95,7 +95,7 @@ function USPS(options) {
} else if (data.Error) {
// Invalid credentials or Invalid Tracking Number
return callback(new Error(data.Error.Description[0]));
} else if (data.TrackResponse.TrackInfo[0].Error) {
} else if (!data?.TrackResponse?.TrackInfo?.[0] || data.TrackResponse.TrackInfo[0].Error) {
// No Tracking Information
return callback(null, results);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -40,5 +40,5 @@
"type": "git",
"url": "https://github.com/mediocre/bloodhound.git"
},
"version": "1.11.8"
"version": "1.11.9"
}

0 comments on commit a91dac0

Please sign in to comment.