mirror of
https://github.com/DoctorMcKay/node-steamcommunity.git
synced 2024-12-28 07:30:09 +08:00
Added userID guard
Because I got this: ``` 2019-06-12 | 01:22:30.151 | ERROR | crashBot | Fatal error: TypeError: Cannot read property 'getSteamID64' of null at get (node_modules\steamcommunity\components\users.js:416:60) at SteamCommunity.getUserInventoryContents (node_modules\steamcommunity\components\users.js:412:2) at unpackSteamBoosterPacks (index.js:3588:21) at cleanupSteamInventory (index.js:3583:5) at SteamUser.refreshSteamWebSession (index.js:857:38) at Object.onceWrapper (events.js:273:13) at SteamUser.emit (events.js:182:13) at SteamUser.gotSteamWebSession (index.js:1754:16) at SteamUser.emit (events.js:182:13) at _apiRequest (node_modules\steam-user\components\web.js:61:9) at IncomingMessage.<anonymous> (node_modules\steam-user\components\webapi.js:82:4) at IncomingMessage.emit (events.js:187:15) at endReadableNT (_stream_readable.js:1094:12) at process._tickCallback (internal/process/next_tick.js:63:19) ```
This commit is contained in:
parent
0df2662053
commit
98373708e5
@ -397,6 +397,11 @@ SteamCommunity.prototype.getUserInventory = function(userID, appID, contextID, t
|
||||
* @param {function} callback
|
||||
*/
|
||||
SteamCommunity.prototype.getUserInventoryContents = function(userID, appID, contextID, tradableOnly, language, callback) {
|
||||
if (!userID) {
|
||||
callback(new Error("The user's SteamID is invalid or missing."));
|
||||
return;
|
||||
}
|
||||
|
||||
var self = this;
|
||||
|
||||
if (typeof userID === 'string') {
|
||||
|
Loading…
Reference in New Issue
Block a user