From c9bc4b1b0b4c6d4291010e885a691bd7df6d3f90 Mon Sep 17 00:00:00 2001 From: Wolmin <44748271+Wolmin@users.noreply.github.com> Date: Thu, 14 Nov 2024 11:45:06 +0100 Subject: [PATCH] fix: Check for null profile names (#26) --- lib/api/graphTypes.ts | 4 ++-- lib/api/useUniversalProfileApiFetch.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/api/graphTypes.ts b/lib/api/graphTypes.ts index 06c3052563..54e26b63f2 100644 --- a/lib/api/graphTypes.ts +++ b/lib/api/graphTypes.ts @@ -6,8 +6,8 @@ export type ProfileImage = { export type SearchProfileQueryResponse = { profileImages: Array; id: string; - name: string; - fullName: string; + name: string | null; + fullName: string | null; }; export type GraphQuery = { diff --git a/lib/api/useUniversalProfileApiFetch.ts b/lib/api/useUniversalProfileApiFetch.ts index eb4e844158..73764b97e5 100644 --- a/lib/api/useUniversalProfileApiFetch.ts +++ b/lib/api/useUniversalProfileApiFetch.ts @@ -34,7 +34,7 @@ export default function useUniversalProfileApiFetch() { const hitAsUp = hit as unknown as SearchProfileQueryResponse; return { type: 'universal_profile', - name: hitAsUp.name !== '' ? hitAsUp.name.trim() : null, + name: hitAsUp.name != null && hitAsUp.name !== '' ? hitAsUp.name.trim() : null, address: getCheckedSummedAddress(hit.id), is_smart_contract_verified: false, };