seishun / node-steam

Interface directly with Steam servers from Node.js
MIT License
1k stars 181 forks source link

Cannot read property send of undefined #368

Closed borianm closed 8 years ago

borianm commented 8 years ago
/home/node_modules/steam/lib/steam_client.js:114`
  this._connection.send(Buffer.concat([header.toBuffer(), body]));
                  ^

TypeError: Cannot read property 'send' of undefined
    at SteamClient._send (/home/node_modules/steam/lib/steam_client.js:114:19)
    at SteamClient.send (/home/node_modules/steam/lib/steam_client.js:123:8)
    at SteamUser.requestWebAPIAuthenticateUserNonce (/home/node_modules/steam/lib/handlers/user/index.js:37:16)
    at SteamWebLogOn.<anonymous> (/home/node_modules/steam-weblogon/index.js:32:23)
    at ClientRequest.<anonymous> (/home/node_modules/steam-web-api/index.js:34:9)
    at ClientRequest.g (events.js:260:16)
    at emitOne (events.js:77:13)
    at ClientRequest.emit (events.js:169:7)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:419:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:103:23)

I think this is the main reason my bot script often goes full dead. This happens usually when Steam is having issues, so could u tell me how to catch this error and don't get a fatal error.

seishun commented 8 years ago

You're calling requestWebAPIAuthenticateUserNonce while the client is logged off.