NoMethodError in Web#web_subcategory

Showing /var/www/vhosts/backsidemoda.com/backsidemoda/app/views/web/menu/_promotion_block.html.erb where line #26 raised:

undefined method `id' for nil:NilClass

Extracted source (around line #26):

23
24
25
26
27
28
29
          
<% end %>
<% else %>
<% BlockPromotion.where("(category_id = ? or category_id is NULL) and (brand_id = ? or brand_id is NULL )", @category.id, marca.id).each do |p| %>
<% if((Date.today >= p.start_date)&(Date.today < p.end_date)) %>

Trace of template inclusion: app/views/web/web_subcategory.html.erb

Rails.root: /var/www/vhosts/backsidemoda.com/backsidemoda

Application Trace | Framework Trace | Full Trace
app/views/web/menu/_promotion_block.html.erb:26:in `_app_views_web_menu__promotion_block_html_erb__3042622321471770359_70179388002500'
app/views/web/web_subcategory.html.erb:143:in `_app_views_web_web_subcategory_html_erb___4350274929243146388_70179369055860'

Request

Parameters:

{"brand"=>"Ellese",
 "id"=>"1-hombre"}

Response

Headers:

None