Skip to content

Commit b30c4d0

Browse files
committed
[Dashboard] Fix: Handle null publisher profile (#5372)
1 parent 6b853df commit b30c4d0

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

apps/dashboard/src/app/(dashboard)/profile/[addressOrEns]/ProfileUI.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { PublishedContracts } from "./components/published-contracts";
1313
export function ProfileUI(props: {
1414
profileAddress: string;
1515
ensName: string | undefined;
16-
publisherProfile: ProfileMetadata;
16+
publisherProfile: ProfileMetadata | null;
1717
showEditProfile: boolean;
1818
}) {
1919
const { profileAddress, ensName, publisherProfile, showEditProfile } = props;
@@ -34,21 +34,25 @@ export function ProfileUI(props: {
3434
{displayName}
3535
</h1>
3636

37-
{publisherProfile.bio && (
37+
{publisherProfile?.bio && (
3838
<p className="line-clamp-2 text-muted-foreground">
3939
{publisherProfile.bio}
4040
</p>
4141
)}
4242

4343
<div className="-translate-x-2 mt-1">
44-
<PublisherSocials publisherProfile={publisherProfile} />
44+
{publisherProfile && (
45+
<PublisherSocials publisherProfile={publisherProfile} />
46+
)}
4547
</div>
4648
</div>
4749
</div>
4850

4951
{showEditProfile && (
5052
<div className="shrink-0">
51-
<EditProfile publisherProfile={publisherProfile} />
53+
{publisherProfile && (
54+
<EditProfile publisherProfile={publisherProfile} />
55+
)}
5256
</div>
5357
)}
5458
</div>

apps/dashboard/src/app/(dashboard)/profile/[addressOrEns]/page.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ export default async function Page(props: PageProps) {
2626
resolvedInfo.address,
2727
).catch(() => null);
2828

29-
if (!publisherProfile) {
30-
return notFound();
31-
}
32-
3329
return (
3430
<ProfileUI
3531
ensName={resolvedInfo.ensName}

0 commit comments

Comments
 (0)