From 1bb2125c906916f4182745d5c237d6da9cca0c12 Mon Sep 17 00:00:00 2001 From: Juan Tejada Date: Thu, 17 Mar 2016 11:14:58 -0700 Subject: [PATCH] fix(tasks): Don't pass null category to task factory - This was causing: https://sentry.nylas.com/sentry/edgehill/group/20965/ --- src/mailbox-perspective.coffee | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mailbox-perspective.coffee b/src/mailbox-perspective.coffee index 4e2095aaf..c8b73681a 100644 --- a/src/mailbox-perspective.coffee +++ b/src/mailbox-perspective.coffee @@ -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 [] )