Skip to content

Commit

Permalink
issue freeCodeCamp#533: fixed page crashing if mock-fcc-data endpoint…
Browse files Browse the repository at this point in the history
… is not running
  • Loading branch information
sudo-benjamin committed Dec 31, 2024
1 parent e28118d commit e53302f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions util/api_proccesor.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,12 @@ export function createDashboardObject(superblock) {
}

export async function fetchStudentData() {
let data = await fetch(process.env.MOCK_USER_DATA_URL);
return data.json();
try {
let data = await fetch(process.env.MOCK_USER_DATA_URL);
return data.json();
} catch (error) {
return [];
}
}

export async function formattedStudentData() {
Expand Down

0 comments on commit e53302f

Please sign in to comment.