From f83d67b527c880eb40c80c6754c381b567ef4396 Mon Sep 17 00:00:00 2001 From: elpatron Date: Wed, 3 Jun 2026 12:51:40 +0200 Subject: [PATCH] Fix TypeScript null check when preserving AI summary on crew save. Co-authored-by: Cursor --- client/src/components/LogEntryEditor.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/client/src/components/LogEntryEditor.tsx b/client/src/components/LogEntryEditor.tsx index 9e57797..db848e5 100644 --- a/client/src/components/LogEntryEditor.tsx +++ b/client/src/components/LogEntryEditor.tsx @@ -470,12 +470,14 @@ export default function LogEntryEditor({ const local = await db.entries.get(entryId) if (local) { const decrypted = await tryDecryptEntryPayload(local, masterKey) - const existing = - decrypted && typeof decrypted.aiSummary === 'string' ? decrypted.aiSummary.trim() : '' - if (existing) { - summaryToSave = existing - summaryAtToSave = - typeof decrypted.aiSummaryGeneratedAt === 'string' ? decrypted.aiSummaryGeneratedAt : '' + if (decrypted) { + const existing = + typeof decrypted.aiSummary === 'string' ? decrypted.aiSummary.trim() : '' + if (existing) { + summaryToSave = existing + summaryAtToSave = + typeof decrypted.aiSummaryGeneratedAt === 'string' ? decrypted.aiSummaryGeneratedAt : '' + } } } }