creesch / discordIRCd

A node.js script that allows you to connect to discord with your irc client.
Apache License 2.0
116 stars 21 forks source link

WHOIS command: handle unknown nick #31

Open pacien opened 7 years ago

pacien commented 7 years ago

…Instead of crashing.

                        const userID = ircDetails[socket.discordid].members[whoisUser];
                                                                           ^
TypeError: Cannot read property '<NICK>' of undefined
    at /opt/discordIRCd/server.js:1392:76
    at Array.forEach (native)
    at Socket.<anonymous> (/opt/discordIRCd/server.js:1149:19)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at Socket.Readable.push (_stream_readable.js:134:10)
    at TCP.onread (net.js:547:20)

Dictionary key is unchecked at: https://github.com/creesch/discordIRCd/blob/04e14d3/server.js#L1392

pacien commented 7 years ago

This seems to happen when connecting to the DMserver using an ircServer.username different from the Discord username.