             variants = [product.masterVariant].concat(product.variants)
             match = _.find variants, (v) ->
               v.sku is masterSku
-            if match
+            if match?
               data =
                 productId: product.id
                 productVersion: product.version

    deferred.promise

  _filterPrices: (retailerVariant, variantInMaster, retailerCustomerGroup, masterCustomerGroup, retailerChannel) ->
    console.error "f retailerVariant %j", retailerVariant
    console.error "f variantInMaster %j", variantInMaster
    console.error "f retailerCustomerGroup %j", retailerCustomerGroup
    console.error "f masterCustomerGroup %j", masterCustomerGroup
    console.error "f retailerChannel %j", retailerChannel

    retailerPrices = _.select retailerVariant.prices, (price) ->
      not _.has(price, 'customerGroup') or price.customerGroup.id is retailerCustomerGroup.id


        price.channel =
          typeId: 'channel'
          id: channelId
        # when the price has a customerGroup set, we have to update the id with the one from master
        if _.has price, 'customerGroup'
          price.customerGroup.id = masterCustomerGroupId

