fix: add null guards for getChromaSync() when Chroma is disabled (#1336)

When CLAUDE_MEM_CHROMA_ENABLED=false, getChromaSync() returns null.
Two call sites were missing null guards, causing "null is not an object"
errors on every UserPromptSubmit / session init.

Fixes #1294

Vibe-coded by Ousama Ben Younes

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Ben Younes
2026-03-13 03:58:03 +01:00
committed by GitHub
parent 4616f7ab1c
commit 503bda4868
2 changed files with 4 additions and 1 deletions
@@ -356,7 +356,7 @@ export class SessionRoutes extends BaseRouteHandler {
// Sync user prompt to Chroma
const chromaStart = Date.now();
const promptText = latestPrompt.prompt_text;
this.dbManager.getChromaSync().syncUserPrompt(
this.dbManager.getChromaSync()?.syncUserPrompt(
latestPrompt.id,
latestPrompt.memory_session_id,
latestPrompt.project,