   ###
   getRandomSnippet: (callback) ->
 
-    return  unless @snippets and @isEnabled()
+    return  unless @snippets? and @isEnabled()
 
     ranges = null
     sum    = 0



  ###*
   * Method loads snippet data and when it's ready emits event to tell that snippet needs to be shown with specified data.
   * It doesn't have a check that current user is admin and usually it's called
   * from console to debug snippets on UI
   *
   * @param {string} name - name of snippet
   * @emits SnippetNeedsToBeShown
  ###
  show: (name) ->

    return kd.log "MarketingController: couldn't show unknown snippet '#{name}'"  unless @snippets[name]
    @getSnippet name, (snippet) => @emit 'SnippetNeedsToBeShown', snippet



  ###
  getSnippet: (name, callback) ->

    return  unless @snippets?[name]

    { type, file } = @snippets[name]

