fix messages findOne (#342)

This commit is contained in:
an-lee
2024-02-22 22:17:46 +08:00
committed by GitHub
parent 086d4fa7bf
commit 74e061ccac
4 changed files with 22 additions and 20 deletions

View File

@@ -61,7 +61,7 @@ export const AssistantMessageComponent = (props: {
const findOrCreateSpeech = async () => {
const msg = await EnjoyApp.messages.findOne({ id: message.id });
if (msg.speeches.length > 0) {
if (msg && msg.speeches.length > 0) {
setSpeech(msg.speeches[0]);
} else {
createSpeech();