From fece83715cb701ae618f41912d7f316e477cc71f Mon Sep 17 00:00:00 2001 From: Ann Rose Date: Mon, 1 Jun 2026 09:09:53 +0530 Subject: [PATCH] missing HTTP response validation in the profile fetch logic --- src/pages/ContributorProfile/ContributorProfile.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pages/ContributorProfile/ContributorProfile.tsx b/src/pages/ContributorProfile/ContributorProfile.tsx index ed1b714d..9f35e05f 100644 --- a/src/pages/ContributorProfile/ContributorProfile.tsx +++ b/src/pages/ContributorProfile/ContributorProfile.tsx @@ -26,6 +26,9 @@ export default function ContributorProfile() { try { const userRes = await fetch(`https://api.github.com/users/${username}`); + if (!userRes.ok) { + throw new Error("Failed to fetch user data."); + } const userData = await userRes.json(); setProfile(userData);