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; } }