From cf20fedc217157165d439bc0ffc9dd197af7be4f Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Sun, 6 Jun 2021 22:55:39 -0400 Subject: [PATCH] fix npe --- vocodes/src/v2/profile/ProfileFc.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/vocodes/src/v2/profile/ProfileFc.tsx b/vocodes/src/v2/profile/ProfileFc.tsx index 7d705f54e5..f87145a78c 100644 --- a/vocodes/src/v2/profile/ProfileFc.tsx +++ b/vocodes/src/v2/profile/ProfileFc.tsx @@ -33,13 +33,13 @@ interface UserPayload { avatar_public_bucket_hash: string, disable_gravatar: boolean, hide_results_preference: boolean, - website_url?: string, - discord_username?: string, - twitch_username?: string, - twitter_username?: string, - github_username?: string, + website_url: string | undefined | null, + discord_username: string | undefined | null, + twitch_username: string | undefined | null, + twitter_username: string | undefined | null, + github_username: string | undefined | null, //patreon_username?: string, - cashapp_username?: string, + cashapp_username: string | undefined | null, created_at: string, } @@ -95,9 +95,9 @@ function ProfileFc(props: Props) { let profileRows : Array = []; - if (userData !== undefined && userData.website_url !== undefined) { + if (userData !== undefined && userData.website_url !== undefined && userData.website_url !== null) { let websiteUrl = {userData.website_url}; - if (userData.website_url.startsWith("http://") || userData.website_url.startsWith("https://")) { + if (userData?.website_url?.startsWith("http://") || userData?.website_url?.startsWith("https://")) { websiteUrl = (