From 60e706f598dd4e462b2c66af35437d0798980ea1 Mon Sep 17 00:00:00 2001 From: Sacha GUERIN Date: Sun, 20 Jul 2025 21:12:51 +0000 Subject: [PATCH] Update frontend/src/pages/Account.jsx Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- frontend/src/pages/Account.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/pages/Account.jsx b/frontend/src/pages/Account.jsx index aad1545..2931bf2 100644 --- a/frontend/src/pages/Account.jsx +++ b/frontend/src/pages/Account.jsx @@ -59,6 +59,10 @@ export default function Account() { } } const fetchUserPlaylists = async () => { + if (!user.id || !token) { + console.warn("User ID or token missing, skipping playlists fetch"); + return; + } try { const response = await fetch(`/api/playlists/user/${user.id}`, { method: "GET", @@ -73,7 +77,6 @@ export default function Account() { setUserPlaylists(data); } catch (error) { console.error("Error fetching user playlists:", error); - return null; } }