fix(chat): test expectation, short circuit if no group

This commit is contained in:
SabreCat
2022-06-02 16:43:14 -05:00
parent 219bdc088b
commit ce67f06bab
2 changed files with 4 additions and 37 deletions
+1 -1
View File
@@ -126,7 +126,7 @@ api.postChat = {
const group = await Group.getGroup({ user, groupId });
// Check message for banned slurs
if (group.privacy !== 'private' && textContainsBannedSlur(req.body.message)) {
if (group && group.privacy !== 'private' && textContainsBannedSlur(req.body.message)) {
const { message } = req.body;
user.flags.chatRevoked = true;
await user.save();