mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-20 22:23:53 +08:00
fix(phishing-detection): undefined messages no longer throws exception
Summary: fixes T4078 Test Plan: manual Reviewers: bengotow Maniphest Tasks: T4078 Differential Revision: https://phab.nylas.com/D2111
This commit is contained in:
parent
9803c0d5f9
commit
6cf6f9087e
2 changed files with 4 additions and 4 deletions
|
@ -55,7 +55,7 @@ class PhishingIndicator extends React.Component
|
|||
# This package's strategy to ascertain whether or not the email is a
|
||||
# phishing attempt boils down to checking the `replyTo` attributes on
|
||||
# `Message` models from `MessageStore`.
|
||||
if message.replyTo? and message.replyTo.length != 0
|
||||
if message?.replyTo? and message.replyTo.length != 0
|
||||
|
||||
# The `from` and `replyTo` attributes on `Message` models both refer to
|
||||
# arrays of `Contact` models, which in turn have `email` attributes.
|
||||
|
@ -65,9 +65,9 @@ class PhishingIndicator extends React.Component
|
|||
# This is our core logic for our whole package! If the `from` and
|
||||
# `replyTo` emails are different, then we want to show a phishing warning.
|
||||
if reply_to isnt from
|
||||
return [from, reply_to]
|
||||
return [from, reply_to]
|
||||
|
||||
return [null, null];
|
||||
return [null, null]
|
||||
|
||||
module.exports =
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "phishing",
|
||||
"version": "0.2.0",
|
||||
"version": "0.2.1",
|
||||
"main": "./lib/main",
|
||||
"description": "An example package for Nylas Mail that translates drafts into other languages using the Yandex API.",
|
||||
"license": "Proprietary",
|
||||
|
|
Loading…
Reference in a new issue