callahanrts / slack-chat

MIT License
49 stars 3 forks source link

Uncaught TypeError: Cannot read property 'name' of undefined #16

Closed Zigzag968 closed 9 years ago

Zigzag968 commented 9 years ago

Hi, I was typing a message to the channel #general and i got this error

Atom Version: 0.209.0 System: Mac OS X 10.10.3 Thrown From: slack-chat package, v3.1.6

Stack Trace

Uncaught TypeError: Cannot read property 'name' of undefined

At /Users/guibert/.atom/packages/slack-chat/lib/state-controller.coffee:58

TypeError: Cannot read property 'name' of undefined
  at StateController.module.exports.StateController.message (/Users/guibert/.atom/packages/slack-chat/lib/state-controller.coffee:58:44)
  at StateController.message (/Users/guibert/.atom/packages/slack-chat/lib/state-controller.coffee:2:1)
  at /Users/guibert/.atom/packages/slack-chat/lib/state-controller.coffee:40:7
  at WebSocket.<anonymous> (/Users/guibert/.atom/packages/slack-chat/node_modules/sc-client/lib/app.js:135:27)
  at emitTwo (events.js:87:13)
  at WebSocket.emit (events.js:169:7)
  at Receiver.ontext (/Users/guibert/.atom/packages/slack-chat/node_modules/sc-client/node_modules/ws/lib/WebSocket.js:797:10)
  at /Users/guibert/.atom/packages/slack-chat/node_modules/sc-client/node_modules/ws/lib/Receiver.js:473:18
  at Receiver.applyExtensions (/Users/guibert/.atom/packages/slack-chat/node_modules/sc-client/node_modules/ws/lib/Receiver.js:360:5)
  at /Users/guibert/.atom/packages/slack-chat/node_modules/sc-client/node_modules/ws/lib/Receiver.js:462:14
  at Receiver.flush (/Users/guibert/.atom/packages/slack-chat/node_modules/sc-client/node_modules/ws/lib/Receiver.js:336:3)
  at Receiver.opcodes.1.finish (/Users/guibert/.atom/packages/slack-chat/node_modules/sc-client/node_modules/ws/lib/Receiver.js:478:12)
  at Receiver.expectHandler (/Users/guibert/.atom/packages/slack-chat/node_modules/sc-client/node_modules/ws/lib/Receiver.js:453:31)
  at Receiver.add (/Users/guibert/.atom/packages/slack-chat/node_modules/sc-client/node_modules/ws/lib/Receiver.js:91:24)
  at TLSSocket.firstHandler (/Users/guibert/.atom/packages/slack-chat/node_modules/sc-client/node_modules/ws/lib/WebSocket.js:774:22)
  at emitOne (events.js:77:13)
  at TLSSocket.emit (events.js:166:7)
  at readableAddChunk (_stream_readable.js:146:16)
  at TLSSocket.Readable.push (_stream_readable.js:109:10)
  at TLSWrap.onread (net.js:517:20)

Commands

     -2:03.1.0 command-palette:toggle (atom-text-editor.editor.is-focused)
     -2:00.1.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -2:00.1.0 slack-chat:toggle (atom-text-editor.editor)
     -1:17.9.0 core:backspace (atom-text-editor.editor.is-focused.autocomplete-active)
     -0:57.4.0 core:select-all (textarea.form-control.native-key-bindings)

Config

{
  "core": {
    "themes": [
      "shiny-ui",
      "monokai-light"
    ],
    "disabledPackages": [
      "tree-view-breadcrumb"
    ]
  },
  "slack-chat": {
    "token": "xoxp-5183510438-6317145587-6318915362-6e1125"
  }
}

Installed Packages

# User
angularjs, v0.3.0
file-icons, v1.5.7
monokai-light, v0.3.7
project-manager, v1.15.10
shiny-ui, v0.33.0
slack-chat, v3.1.6

# Dev
No dev packages
callahanrts commented 9 years ago

Thanks. I'll add a condition to fix this when I get a chance. Was the message from slack a bot or an integration of some sort?

hemanth commented 9 years ago

Appears at random instants, normally when saving a file.

callahanrts commented 9 years ago

It happens when you receive a message that doesn't have an author. It's most likely an integration or something. It shouldn't be occurring anymore.

hemanth commented 9 years ago

Hmm.