From 087fd8544727d30fc2449b934fdd96df848cb089 Mon Sep 17 00:00:00 2001 From: Miikka Virtanen Date: Wed, 15 Feb 2017 01:02:45 +0200 Subject: [PATCH] Fix --- src/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index b9bf1ba..bc0a6e9 100644 --- a/src/index.js +++ b/src/index.js @@ -127,13 +127,15 @@ Here's what their message contained: threadInitDonePromise = memberPromise .then(member => { - const mainGuildNickname = (member ? member.nick || member.username : 'UNKNOWN'); + const mainGuildNickname = (member != null ? (member.nick || member.username) : 'UNKNOWN'); const accountAge = humanizeDuration(Date.now() - msg.author.createdAt, {largest: 2}); const infoHeader = `ACCOUNT AGE **${accountAge}**, ID **${msg.author.id}**, NICKNAME **${mainGuildNickname}**, LOGS **${userLogs.length}**\n-------------------------------`; bot.createMessage(thread.channelId, infoHeader); - }, err => { + }) + .catch(err => { console.log(`Member ${msg.author.id} not found in main guild ${config.mainGuildId}`); + console.error(err); }); // Ping mods of the new thread