<commit_before><%# there has got to be a hipster ruby way to do this better %>
<% params[:f].each do |k,v| %>
  <% v.each do |selected_facet| %>
      <% link_options = remove_facet_params(k, selected_facet, params).merge!Hash["controller" => "catalog", :action=> "index"] %>
      <p class="your-keywords"><a class="itemicon itemcheck">on</a> <%= selected_facet %><%= link_to 'X', url_for(link_options), :class=>'clearkeywords' %>
      </p>
    <% end %>
  <% end %>
<commit_msg>added an if block to make sure facet parameter exists fixes #838<commit_after><%# there has got to be a hipster ruby way to do this better %>
<% if params[:f] %>
  <% params[:f].each do |k,v| %>
    <% v.each do |selected_facet| %>
      <% link_options = remove_facet_params(k, selected_facet, params).merge!Hash["controller" => "catalog", :action=> "index"] %>
      <p class="your-keywords"><a class="itemicon itemcheck">on</a> <%= selected_facet %><%= link_to 'X', url_for(link_options), :class=>'clearkeywords' %>
      </p>
    <% end %>
  <% end %>
<% end %>

{'fraction_non_alphanumeric': 0.19675262655205347, 'fraction_numerical': 0.0028653295128939827, 'mean_word_length': 4.319796954314721, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6634931', 'n_tokens_mistral': 392, 'n_tokens_neox': 347, 'n_words': 92}