evanyeung / terminal-slack

Terminal client for slack
MIT License
1.03k stars 78 forks source link

Cannot read property 'match' of null #33

Closed lennartkoopmann closed 7 years ago

lennartkoopmann commented 7 years ago

On latest master, when opening a channel, the application crashes with this error:

TypeError: Cannot read property 'match' of null
    at formatMessageMentions (/Users/lennartkoopmann/workspace/terminal-slack/main.js:56:28)
    at data.messages.filter.map.forEach (/Users/lennartkoopmann/workspace/terminal-slack/main.js:222:46)
    at Array.forEach (native)
    at updateMessages (/Users/lennartkoopmann/workspace/terminal-slack/main.js:219:6)
    at slack.getChannelHistory (/Users/lennartkoopmann/workspace/terminal-slack/main.js:275:7)
    at slackRequest (/Users/lennartkoopmann/workspace/terminal-slack/slackClient.js:74:9)
    at Request.request.get [as _callback] (/Users/lennartkoopmann/workspace/terminal-slack/slackClient.js:40:7)
    at Request.self.callback (/Users/lennartkoopmann/workspace/terminal-slack/node_modules/request/request.js:186:22)
    at emitTwo (events.js:106:13)
    at Request.emit (events.js:191:7)
evanyeung commented 7 years ago

Hi, thanks for bringing this up. I didn't realize there are some types of messages that don't have text. At the moment, terminal-slack doesn't support them anyway (it looks like this was probably caused by message threading?), so I've filtered out messages that don't have a text field.

For now, the issue should have been fixed with commit 9a2d91445a0df141d6cbf53d69ead8d4de1e26c3.