{"action":"closed","issue":{"url":"https://api.github.com/repos/shaunburdick/slack-ooo/issues/16","repository_url":"https://api.github.com/repos/shaunburdick/slack-ooo","labels_url":"https://api.github.com/repos/shaunburdick/slack-ooo/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/shaunburdick/slack-ooo/issues/16/comments","events_url":"https://api.github.com/repos/shaunburdick/slack-ooo/issues/16/events","html_url":"https://github.com/shaunburdick/slack-ooo/issues/16","id":177517436,"number":16,"title":"Bug: Bot crashes when anyone posts in the channels","user":{"login":"andela-anandaa","id":13568167,"avatar_url":"https://avatars.githubusercontent.com/u/13568167?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-anandaa","html_url":"https://github.com/andela-anandaa","followers_url":"https://api.github.com/users/andela-anandaa/followers","following_url":"https://api.github.com/users/andela-anandaa/following{/other_user}","gists_url":"https://api.github.com/users/andela-anandaa/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-anandaa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-anandaa/subscriptions","organizations_url":"https://api.github.com/users/andela-anandaa/orgs","repos_url":"https://api.github.com/users/andela-anandaa/repos","events_url":"https://api.github.com/users/andela-anandaa/events{/privacy}","received_events_url":"https://api.github.com/users/andela-anandaa/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/shaunburdick/slack-ooo/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-16T20:49:41Z","updated_at":"2016-09-17T00:33:16Z","closed_at":"2016-09-17T00:33:16Z","body":"The bot crashes immediately someone posts on any of the channels that the bot is in.\r\n```\r\nerror: uncaughtException: Cannot read property 'length' of null \r\n```\r\nBeing raised from line 155 in `bot.js` when there's no matches from line 154\r\n```javascript\r\nconst matches = message.text.match(/@\\w+/g);\r\nif (matches.length) {\r\n```\r\nSo `matches` is `null`.\r\n\r\nProposed fix for line 155:\r\n```javascript\r\nif (matches && matches.length) { \r\n```\r\n\r\nTested, the bot works fine after this fix.\r\n\r\nCan go ahead and raise the PR once #15 is done since we've some minor changes in the test files that will be carry over here."}}
{"actor":{"display_login":"shaunburdick"}}