protect from null mentions
This commit is contained in:
parent
c239d05e30
commit
099a578a1b
@ -294,8 +294,8 @@ const createMentions = async (item, models) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const mentions = item.text.match(namePattern).map(m => m.slice(1))
|
const mentions = item.text.match(namePattern)?.map(m => m.slice(1))
|
||||||
if (mentions.length > 0) {
|
if (mentions?.length > 0) {
|
||||||
const users = await models.user.findMany({
|
const users = await models.user.findMany({
|
||||||
where: {
|
where: {
|
||||||
name: { in: mentions }
|
name: { in: mentions }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user