From 14819f0b732ca0cd3a11ae6fc9b2e01aa4ad61c8 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Sat, 13 Dec 2025 21:18:50 -0800 Subject: [PATCH] fix null check for layout data during error scenarios --- src/routes/+layout.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/routes/+layout.ts b/src/routes/+layout.ts index 8e87fa74..0583dc6b 100644 --- a/src/routes/+layout.ts +++ b/src/routes/+layout.ts @@ -13,7 +13,8 @@ import { authStore } from '$lib/stores/auth.store' export const load: LayoutLoad = async ({ data }) => { // Initialize auth store from server data BEFORE creating QueryClient - if (browser && data.auth) { + // Defensive check: data might be null/undefined during error scenarios + if (browser && data?.auth) { authStore.initFromServer( data.auth.accessToken, data.auth.user,