Skip to content

Commit 6193cea

Browse files
devakoneclaude
andcommitted
fix: use maybeSingle for profile share route to avoid PGRST116 crash
When no unified profile exists yet, .single() throws instead of returning null. Switch to .maybeSingle() so the existing 404 handler responds gracefully. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 564198f commit 6193cea

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • apps/web/src/app/api/share/[format]/[userId]

apps/web/src/app/api/share/[format]/[userId]/route.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export async function GET(
6565
.from("user_profiles")
6666
.select("persona_id, persona_name, persona_tagline, persona_confidence, total_repos, total_commits, axes_json, narrative_json")
6767
.eq("user_id", userId)
68-
.single();
68+
.maybeSingle();
6969

7070
if (error) {
7171
console.error("Supabase error:", error);

0 commit comments

Comments
 (0)