From 65a4f322c78b135066472f45163754dc0403380d Mon Sep 17 00:00:00 2001 From: Kieran Date: Fri, 9 Sep 2022 19:22:57 +0100 Subject: [PATCH] Fix random null crashes --- events/guildScheduledEvent.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/events/guildScheduledEvent.js b/events/guildScheduledEvent.js index 28637ca..603d82c 100644 --- a/events/guildScheduledEvent.js +++ b/events/guildScheduledEvent.js @@ -8,9 +8,12 @@ client.on('guildScheduledEventCreate', async guildScheduledEvent =>{ .setTitle(guildScheduledEvent.name) .setDescription(guildScheduledEvent.description) .setColor('GREEN') - .setFooter({text: `Created by ${guildScheduledEvent.creator.tag}`}) - .setTimestamp() - .setImage(`https://cdn.discordapp.com/guild-events/${guildScheduledEvent.id}/${guildScheduledEvent.image}.png?size=2048`) + if(interaction.user.tag !== null) + { + embed.setFooter({text: `Created by ${guildScheduledEvent.creator.tag}`}) + } + embed.setTimestamp() + embed.setImage(`https://cdn.discordapp.com/guild-events/${guildScheduledEvent.id}/${guildScheduledEvent.image}.png?size=2048`) if(guildScheduledEvent.entityType !== 'EXTERNAL') {