mentions: fix exception when mentioning nonexistent user.

This commit is contained in:
evazion
2021-02-05 19:40:30 -06:00
parent 7dbf3c53ab
commit 031032326e
2 changed files with 7 additions and 1 deletions

View File

@@ -28,7 +28,7 @@ module Mentionable
text_was = send(:attribute_before_last_save, message_field)
names = DText.parse_mentions(text) - DText.parse_mentions(text_was)
users = names.map { |name| User.find_by_name(name) }.uniq
users = names.map { |name| User.find_by_name(name) }.compact.uniq
users = users.without(CurrentUser.user)
users.each do |user|