fix: prohibit word nil error

This commit is contained in:
tangtaoit 2024-12-06 10:40:03 +08:00
parent 1fa8523dfe
commit 441a09bc29

View File

@ -256,7 +256,9 @@ export class ChatVM extends ProviderListener {
if (conversations && conversations.length > 0) { if (conversations && conversations.length > 0) {
for (const conversation of conversations) { for (const conversation of conversations) {
if(conversation.lastMessage?.content && conversation.lastMessage?.contentType == MessageContentType.text) { if(conversation.lastMessage?.content && conversation.lastMessage?.contentType == MessageContentType.text) {
conversation.lastMessage.content.text = ProhibitwordsService.shared.filter(conversation.lastMessage.content.text) if (conversation.lastMessage.content.text) {
conversation.lastMessage.content.text = ProhibitwordsService.shared.filter(conversation.lastMessage.content.text )
}
} }
conversationWraps.push(new ConversationWrap(conversation)) conversationWraps.push(new ConversationWrap(conversation))
} }