message_list: Fix handling of unknown email in mentions.

If a user has an old mention and has since been renamed, there's
really nothing for us to do to render it; we should just return as
though we have no data.
This commit is contained in:
Tim Abbott
2018-12-16 14:35:39 -08:00
parent 046ecc5d50
commit 0779d343fa

View File

@@ -32,7 +32,11 @@ function get_user_id_for_mention_button(elem) {
if (email) {
// Will return undefined if there's no match
return people.get_by_email(email).user_id;
var user = people.get_by_email(email);
if (user) {
return user.user_id;
}
return;
}
return;
}