Adding null safety

This commit is contained in:
2023-08-14 22:16:30 +02:00
parent 90f8d23d61
commit 1905dafde5

View File

@@ -85,9 +85,7 @@ module.exports = {
var username = user1.username + "#" + user1.discriminator var username = user1.username + "#" + user1.discriminator
} }
const linkedDiscord = stats.data.player.socialMedia.links.DISCORD if (!stats.data.player.socialMedia.links.DISCORD) {
if (!linkedDiscord) {
interaction.editReply({ interaction.editReply({
embeds: [ embeds: [
{ {
@@ -99,7 +97,7 @@ module.exports = {
}); });
return; return;
} }
if (linkedDiscord !== username) { if (stats.data.player.socialMedia.links.DISCORD !== username) {
interaction.editReply({ interaction.editReply({
embeds: [ embeds: [
{ {
@@ -191,4 +189,4 @@ module.exports = {
] ]
}); });
} }
}; };