Skip to content

Commit

Permalink
[client-sync] Fix contact ranking error
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Mark Hahnenberg committed Apr 13, 2017
1 parent 91f5ca4 commit b112343
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/client-sync/src/local-api/routes/contacts.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit b112343

Please sign in to comment.