       else
         Promise.all cats.map (cat) =>
           @_resolveReference(@client.categories, 'categories', cat, "externalId=\"#{cat.id}\"")
-        .then (result) -> resolve(result.filter (c) => c)
+        .then (result) -> resolve(result.filter (c) -> c)
 
   _resolveReference: (service, refKey, ref, predicate) ->
     new Promise (resolve) =>

          id: taxCatId
          typeId: 'tax-category'
      if prodCatsIds
        product.categories = _.map prodCatsIds, (catId) =>
          id: catId
          typeId: 'category'
      Promise.resolve product

debug = require('debug')('sphere-product-sync-import')
_ = require 'underscore'
_.mixin require 'underscore-mixins'
Promise = require 'bluebird'
{SphereClient, ProductSync} = require 'sphere-node-sdk'

