seishun / node-steam

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

.send() is being called after disconnecting from Steam #401

Closed luop90 closed 7 years ago

luop90 commented 7 years ago

...which crashes the app.

Here's the full error output:

/home/luop/bot/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/luop/bot/node_modules/steam/lib/steam_client.js:114:19)
    at SteamClient.send (/home/luop/bot/node_modules/steam/lib/steam_client.js:123:8)
    at SteamUser.requestWebAPIAuthenticateUserNonce (/home/luop/bot/node_modules/steam/lib/handlers/user/index.js:37:16)
    at SteamWebLogOn.<anonymous> (/home/luop/bot/node_modules/steam-weblogon/index.js:34:23)
    at ClientRequest.<anonymous> (/home/luop/bot/node_modules/steam-weblogon/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:430:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:103:23)
seishun commented 7 years ago

It's being (indirectly) called by steam-weblogon. You should report your issue there.

You can check whether you're currently logged on by inspecting the steamClient.loggedOn property. If it's false, then you must not call any handler methods (except logOn), including requestWebAPIAuthenticateUserNonce.