fix: add optional chaining to prevent undefined error when accessing first_mes (#4601)
Signed| @@ -6680,7 +6680,7 @@ async function getChatResult() { | |||
| 6680 | } | 6680 | } |
| 6681 | 6681 | ||
| 6682 | function getFirstMessage() { | 6682 | function getFirstMessage() { |
| 6683 | const firstMes = characters[this_chid].first_mes || ''; | 6683 | const firstMes = characters[this_chid]?.first_mes || ''; |
| 6684 | const alternateGreetings = characters[this_chid]?.data?.alternate_greetings; | 6684 | const alternateGreetings = characters[this_chid]?.data?.alternate_greetings; |
| 6685 | 6685 | ||
| 6686 | const message = { | 6686 | const message = { |