From f96b1a35859f8901a2225bc881e8cc59667617ea Mon Sep 17 00:00:00 2001 From: benji7425 Date: Wed, 23 Aug 2017 01:15:11 +0100 Subject: [PATCH] Fix issue posting link if role is null --- app/models/feed-data.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/feed-data.js b/app/models/feed-data.js index 2372304..d39ce45 100644 --- a/app/models/feed-data.js +++ b/app/models/feed-data.js @@ -57,8 +57,8 @@ module.exports = class FeedData { this.cachedLinks.push(latest); const channel = guild.channels.find(ch => ch.type === "text" && ch.name.toLowerCase() === this.channelName.toLowerCase()); - const role = guild.roles.find(role => role.name.toLowerCase() === this.roleName.toLowerCase()); - channel.send(role + " " + latest); + const role = this.roleName ? guild.roles.find(role => role.name.toLowerCase() === this.roleName.toLowerCase()) : null; + channel.send(role ? role + " " : "" + latest); } } });