Fix undefined reasoning append on continue

This commit is contained in:
Cohee 2025-02-01 19:06:39 +02:00
parent d2cc8b36b8
commit cc7355358d

View File

@ -5927,6 +5927,15 @@ export async function saveReply(type, getMessage, fromStreaming, title, swipes,
chat[chat.length - 1]['extra'] = {};
}
// Coerce null/undefined to empty string
if (!chat[chat.length - 1]['extra']['reasoning']) {
chat[chat.length - 1]['extra']['reasoning'] = '';
}
if (!reasoning) {
reasoning = '';
}
let oldMessage = '';
const generationFinished = new Date();
const img = extractImageFromMessage(getMessage);