copygirl / cord

IRC and Discord Chatbot Framework
Other
9 stars 3 forks source link

Crash when creating a channel #11

Closed deathspawn closed 7 years ago

deathspawn commented 7 years ago

Made a channel on Discord and didn't include the bot's role or @everyone and it crashed.

/home/deathspawn/git/relays/cord/sockets/Discord.js:237`
    this._name = this._discordChannel.name;
                                     ^

TypeError: Cannot read property 'name' of null
    at new DiscordChannel (/home/deathspawn/git/relays/cord/sockets/Discord.js:237:38)
    at DiscordSocket._getChannel (/home/deathspawn/git/relays/cord/sockets/Discord.js:114:17)
    at Client.DiscordSocket._discord.on (/home/deathspawn/git/relays/cord/sockets/Discord.js:64:12)
    at emitOne (events.js:96:13)
    at Client.emit (events.js:188:7)
    at ClientDataManager.newChannel (/home/deathspawn/git/relays/cord/node_modules/discord.js/src/client/ClientDataManager.js:68:51)
    at ChannelCreateAction.handle (/home/deathspawn/git/relays/cord/node_modules/discord.js/src/client/actions/ChannelCreate.js:6:40)
    at ChannelCreateHandler.handle (/home/deathspawn/git/relays/cord/node_modules/discord.js/src/client/websocket/packets/handlers/ChannelCreate.js:7:34)
    at WebSocketPacketManager.handle (/home/deathspawn/git/relays/cord/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:93:65)
    at WebSocketManager.eventMessage (/home/deathspawn/git/relays/cord/node_modules/discord.js/src/client/websocket/WebSocketManager.js:198:31)

npm ERR! Linux 4.5.5-x86_64-linode69
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! cord@2.2.0 start: `node cord.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the cord@2.2.0 start script 'node cord.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the cord package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node cord.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs cord
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls cord
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/deathspawn/git/relays/cord/npm-debug.log
copygirl commented 7 years ago

Can confirm, happens a lot when adding or removing channels regardless of access rules. I just avoid doing that in my Discord guild. Never bothered to fix it. I might take a look at it later.

edit: Later is now. Seems to be fixed. Testing.