Skip to content

Commit

Permalink
make sure exception data is json and not undefined for the leaving of…
Browse files Browse the repository at this point in the history
… slack channel
  • Loading branch information
jcolson committed Mar 2, 2019
1 parent d64aa1d commit 062101f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion lib/irslackd.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ class Irslackd {
channel: slackChan,
});
} catch (e) {
if (JSON.parse(e.message).error.data.error === 'last_member') {
if (typeof JSON.parse(e.message) !== 'undefined' && JSON.parse(e.message).error.data.error === 'last_member') {
await ircUser.slackWeb.apiCallOrThrow('conversations.archive', {
channel: slackChan,
});
Expand Down
1 change: 0 additions & 1 deletion rename_private_mod.log
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
slack_in pong { type: 'pong', reply_to: 42 }
slack_in group_rename { type: 'group_rename',
channel:
{ id: 'GGM5P2ZE2',
Expand Down

0 comments on commit 062101f

Please sign in to comment.