Fix reasoning error on empty chat

This commit is contained in:
Wolfsblvt
2025-02-04 00:20:17 +01:00
parent 524ecf8acd
commit da531f12c2

View File

@@ -6004,7 +6004,7 @@ export async function saveReply(type, getMessage, fromStreaming, title, swipes,
} }
// Coerce null/undefined to empty string // Coerce null/undefined to empty string
if (!chat[chat.length - 1]['extra']['reasoning']) { if (chat.length && !chat[chat.length - 1]['extra']['reasoning']) {
chat[chat.length - 1]['extra']['reasoning'] = ''; chat[chat.length - 1]['extra']['reasoning'] = '';
} }