Skip to content

Commit 89d60cb

Browse files
committed
Update AttemptHistory.jsx
- Add Null Checks to ensure the App doesnt crash
1 parent bdf6fdc commit 89d60cb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Frontend/src/Components/LandingPage/AttemptHistory.jsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ export const AttemptHistory = ({isList, setIsList}) => {
1111

1212
const fetchAttempts = async () => {
1313
const results = await getUserAttempts(getUserId());
14+
if (results === null) {
15+
console.log("No Attempt")
16+
return;
17+
}
18+
19+
console.log(results)
1420
setAttempts(results);
1521
};
1622

0 commit comments

Comments
 (0)