Fix error on streaming if the processor was already destroyed

8c095f204a014c5e5f7f784b1f203c6b5089b1d7

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +1 -1Ignore whitespace
public/script.js+1 -1
@@ -4420,7 +4420,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
44204420 const invocationResult = await ToolManager.invokeFunctionTools(streamingProcessor.toolCalls);
44214421 if (invocationResult.hadToolCalls) {
44224422 const lastMessage = chat[chat.length - 1];
44234423 const shouldDeleteMessage = ['', '...'].includes(lastMessage?.mes) && ['', '...'].includes(streamingProcessor?.result);
44244424 shouldDeleteMessage && await deleteLastMessage();
44254425 if (!invocationResult.invocations.length && shouldDeleteMessage) {
44264426 ToolManager.showToolCallError(invocationResult.errors);