From c33d59b45dc2e63ff80ce02287415f8973d90841 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Sun, 8 Oct 2023 03:49:00 +0200 Subject: [PATCH] serverProfile: fix crash with lurked guilds Co-authored-by: aamiaa <9750071+aamiaa@users.noreply.github.com> --- src/plugins/serverProfile/GuildProfileModal.tsx | 2 +- src/plugins/serverProfile/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/serverProfile/GuildProfileModal.tsx b/src/plugins/serverProfile/GuildProfileModal.tsx index 79b38777..2be9b57d 100644 --- a/src/plugins/serverProfile/GuildProfileModal.tsx +++ b/src/plugins/serverProfile/GuildProfileModal.tsx @@ -170,7 +170,7 @@ function ServerInfoTab({ guild }: GuildProps) { const Fields = { "Server Owner": owner ? Owner(guild.id, owner) : "Loading...", "Created At": renderTimestamp(SnowflakeUtils.extractTimestamp(guild.id)), - "Joined At": renderTimestamp(guild.joinedAt.getTime()), + "Joined At": guild.joinedAt ? renderTimestamp(guild.joinedAt.getTime()) : "-", // Not available in lurked guild "Vanity Link": guild.vanityURLCode ? ({`discord.gg/${guild.vanityURLCode}`}) : "-", // Making the anchor href valid would cause Discord to reload "Preferred Locale": guild.preferredLocale || "-", "Verification Level": ["None", "Low", "Medium", "High", "Highest"][guild.verificationLevel] || "?", diff --git a/src/plugins/serverProfile/index.tsx b/src/plugins/serverProfile/index.tsx index c27f8cd5..68f6193c 100644 --- a/src/plugins/serverProfile/index.tsx +++ b/src/plugins/serverProfile/index.tsx @@ -18,7 +18,7 @@ const Patch: NavContextMenuPatchCallback = (children, { guild }: { guild: Guild; group?.push( openGuildProfileModal(guild)} /> );