fix: panics if user not logged in
This commit is contained in:
parent
bb93de3074
commit
885f319565
1 changed files with 2 additions and 0 deletions
|
@ -2,6 +2,8 @@ import type { PageServerLoad } from './$types';
|
|||
|
||||
export const load: PageServerLoad = async ({ locals: { authReq, database } }) => {
|
||||
const session = await authReq.validate();
|
||||
if (!session) return {};
|
||||
|
||||
const tracks = await database.listTracksWithProducer(session.user.userId);
|
||||
|
||||
return {
|
||||
|
|
Loading…
Reference in a new issue