From 8c095f204a014c5e5f7f784b1f203c6b5089b1d7 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Fri, 4 Oct 2024 12:00:20 +0000 Subject: [PATCH] Fix error on streaming if the processor was already destroyed --- public/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/script.js b/public/script.js index 109c6cc36..f34d57cf8 100644 --- a/public/script.js +++ b/public/script.js @@ -4420,7 +4420,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro const invocationResult = await ToolManager.invokeFunctionTools(streamingProcessor.toolCalls); if (invocationResult.hadToolCalls) { const lastMessage = chat[chat.length - 1]; - const shouldDeleteMessage = ['', '...'].includes(lastMessage?.mes) && ['', '...'].includes(streamingProcessor.result); + const shouldDeleteMessage = ['', '...'].includes(lastMessage?.mes) && ['', '...'].includes(streamingProcessor?.result); shouldDeleteMessage && await deleteLastMessage(); if (!invocationResult.invocations.length && shouldDeleteMessage) { ToolManager.showToolCallError(invocationResult.errors);