mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-26 01:48:56 +08:00
[client-sync] Fix contact ranking error
Summary: This was showing up in Sentry. Check to see if the recipient has an email before calling toLowerCase. Test Plan: yolo Reviewers: halla, juan Reviewed By: juan Differential Revision: https://phab.nylas.com/D4423
This commit is contained in:
parent
91f5ca4de9
commit
b1123433d0
1 changed files with 3 additions and 0 deletions
|
@ -16,6 +16,9 @@ const calculateContactScores = (messages, result) => {
|
|||
for (const message of messages) {
|
||||
const weight = getMessageWeight(message, now);
|
||||
for (const recipient of message.getRecipients()) {
|
||||
if (!recipient.email) {
|
||||
continue;
|
||||
}
|
||||
const email = recipient.email.toLowerCase();
|
||||
result[email] = result[email] ? (result[email] + weight) : weight;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue