Fix undefined reasoning append on continue
| @@ -5927,6 +5927,15 @@ export async function saveReply(type, getMessage, fromStreaming, title, swipes, | ||
| 5927 | 5927 | chat[chat.length - 1]['extra'] = {}; |
| 5928 | 5928 | } |
| 5929 | 5929 | |
| 5930 | + // Coerce null/undefined to empty string | |
| 5931 | + if (!chat[chat.length - 1]['extra']['reasoning']) { | |
| 5932 | + chat[chat.length - 1]['extra']['reasoning'] = ''; | |
| 5933 | + } | |
| 5934 | + | |
| 5935 | + if (!reasoning) { | |
| 5936 | + reasoning = ''; | |
| 5937 | + } | |
| 5938 | + | |
| 5930 | 5939 | let oldMessage = ''; |
| 5931 | 5940 | const generationFinished = new Date(); |
| 5932 | 5941 | const img = extractImageFromMessage(getMessage); |