       @$checkmark.hide()
 
     # Add empty states
-    respColors = _.pluck @aggregations.get('COLOR').get('counts'), 'name'
+    respColors = _.pluck @aggregations.get('COLOR')?.get('counts'), 'name'
     emptyColors = _.difference(@colors, respColors)
     _.each(emptyColors, (color) ->
       @$("svg path[data-value='#{color}']").attr('data-empty', true)

_ = require 'underscore'
Backbone = require 'backbone'
template = require('./index.jade')

module.exports = class ColorFilterView extends Backbone.View
  events:

    @params.set page: 1, silent: true
    @params.unset 'color'

  renderSelectedAndEmptyStates: ->
    # First remove all empty states
    _.each(@$clickableColors, (color) =>
      $(color).removeAttr('data-empty')
