extremely claude-assisted go game based on atproto! working on cleaning up and giving a more unique design, still has a bit of a slop vibe to it.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add null checks for DID resolution

Prevent errors when resolving null DIDs to handles.
Returns 'Unknown' for null DIDs instead of crashing.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

+9 -2
+9 -2
src/lib/atproto-client.ts
··· 17 17 }>; 18 18 } 19 19 20 - async function fetchDidDocument(did: string): Promise<DidDocument | null> { 20 + async function fetchDidDocument(did: string | null): Promise<DidDocument | null> { 21 + if (!did) { 22 + console.warn('[fetchDidDocument] Null or empty DID provided'); 23 + return null; 24 + } 25 + 21 26 console.log('[fetchDidDocument] Fetching DID document for:', did); 22 27 23 28 try { ··· 66 71 } 67 72 68 73 /** Resolve a DID to a human-readable handle. Results are cached. */ 69 - export async function resolveDidToHandle(did: string): Promise<string> { 74 + export async function resolveDidToHandle(did: string | null): Promise<string> { 75 + if (!did) return 'Unknown'; 76 + 70 77 const cached = handleCache.get(did); 71 78 if (cached) return cached; 72 79