diff --git a/packages/editor-ui/src/components/CanvasChat/composables/useChatMessaging.ts b/packages/editor-ui/src/components/CanvasChat/composables/useChatMessaging.ts index bbb1e28402..2ceec6b54d 100644 --- a/packages/editor-ui/src/components/CanvasChat/composables/useChatMessaging.ts +++ b/packages/editor-ui/src/components/CanvasChat/composables/useChatMessaging.ts @@ -277,7 +277,7 @@ export function useChatMessaging({ const memoryOutputData = (nodeResultData ?? []) .map((data) => get(data, ['data', NodeConnectionType.AiMemory, 0, 0, 'json']) as MemoryOutput) - .find((data) => data.action === 'saveContext'); + .find((data) => data && data.action === 'saveContext'); return (memoryOutputData?.chatHistory ?? []).map((message, index) => { return {