reasoning-set: Return if message not found

This commit is contained in:
Cohee
2025-02-17 19:54:50 +02:00
parent e5e2c9fe49
commit 87afb1633b

View File

@ -652,6 +652,9 @@ function registerReasoningSlashCommands() {
callback: async (args, value) => {
const messageId = !isNaN(Number(args.at)) ? Number(args.at) : chat.length - 1;
const message = chat[messageId];
if (!message) {
return '';
}
// Make sure the message has an extra object
if (!message.extra || typeof message.extra !== 'object') {
message.extra = {};