Skip to content

Commit 956bd13

Browse files
committed
Fix blank page on client-side navigation to agent profile
Add null safety to DebugTrace store data access in /agents/[id] page. During client-side navigation, the Houdini store data can briefly be null before the GraphQL query resolves, causing a TypeError that crashes the component.
1 parent f459081 commit 956bd13

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ui/src/routes/agents/[id]/+page.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
77
let {data} = $props();
88
let {AgentConfig, DebugTrace} = $derived(data);
9-
let {debugLog} = $derived($DebugTrace.data)
9+
let debugLog = $derived($DebugTrace?.data?.debugLog);
1010
1111
let debugClear = new ClearDebugLogStore();
1212
async function clearLog() {
@@ -21,7 +21,7 @@
2121

2222
<PageHeader title={page.params.id} />
2323
<div class="flex h-full w-full flex-col pr-4 pl-4 overflow-auto">
24-
<EventSequenceRenderer events={debugLog.events} onClear={clearLog}/>
24+
<EventSequenceRenderer events={debugLog?.events ?? []} onClear={() => { clearLog() }}/>
2525
</div>
2626

2727

0 commit comments

Comments
 (0)