fix: prevent insertion of empty message results

This commit is contained in:
lawvs 2025-11-08 15:08:14 +08:00
parent 03c0cc54b5
commit 2dcc2967e4
1 changed files with 3 additions and 0 deletions

View File

@ -180,6 +180,9 @@ class AIPersistServiceStatic {
return acc
}, [])
if (results.length === 0) {
return
}
await db
.insert(aiChatMessagesTable)
.values(results)