fix: Return empty array when user not logged in
This commit is contained in:
parent
96ad8f357e
commit
489a637506
1 changed files with 5 additions and 1 deletions
|
@ -2,7 +2,11 @@ import type { PageServerLoad } from './$types';
|
|||
|
||||
export const load: PageServerLoad = async ({ locals: { authReq, database } }) => {
|
||||
const session = await authReq.validate();
|
||||
if (!session) return {};
|
||||
|
||||
if (!session)
|
||||
return {
|
||||
tracks: []
|
||||
};
|
||||
|
||||
const tracks = await database.listTracksWithProducer(session.user.userId);
|
||||
|
||||
|
|
Loading…
Reference in a new issue