NoMethodError in Web#web_subcategory

Showing /var/www/vhosts/trendclic.it/trendclicitnew/app/views/web/web_subcategory.html.erb where line #30 raised:

undefined method `category' for nil:NilClass

Extracted source (around line #30):

27
28
29
30
31
32
33
          
<% end %>
<% end %>
],
item_list_id: <%= @products.first.category.id %>,
item_list_name: "<%= @products.first.category.name %>",
currency: "EUR",
},

Rails.root: /var/www/vhosts/trendclic.it/trendclicitnew

Application Trace | Framework Trace | Full Trace
app/views/web/web_subcategory.html.erb:30:in `_app_views_web_web_subcategory_html_erb___2462620694136878859_47388392859420'

Request

Parameters:

{"id"=>"70-cinture-bambino"}

Response

Headers:

None