fix(tasks): Don't pass null category to task factory

- This was causing:
  https://sentry.nylas.com/sentry/edgehill/group/20965/
This commit is contained in:
Juan Tejada 2016-03-17 11:14:58 -07:00
parent a3a03bd086
commit f5a9bac151

View file

@ -370,8 +370,10 @@ class CategoryMailboxPerspective extends MailboxPerspective
threads: threads,
categoriesToRemove: (accountId) =>
# Remove all categories from this perspective that match the accountId
_.filter(@_categories, _.matcher({accountId}))
categoriesToAdd: (accId) => [(ruleset[name] ? ruleset.other)(accId)]
return _.filter(@_categories, _.matcher({accountId}))
categoriesToAdd: (accId) =>
category = (ruleset[name] ? ruleset.other)(accId)
return if category then [category] else []
)