NoMethodError in Web#web_subcategory

Showing /var/www/vhosts/lolitamoda.com/lolitamodav7/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/lolitamoda.com/lolitamodav7

Application Trace | Framework Trace | Full Trace
app/views/web/menu/_promotion_block.html.erb:26:in `_app_views_web_menu__promotion_block_html_erb___1452992919778636678_46996278919060'
app/views/web/web_subcategory.html.erb:179:in `_app_views_web_web_subcategory_html_erb___1145858685677870214_46996280652160'

Request

Parameters:

{"brand"=>"Esprit",
 "id"=>"2-hombre"}

Response

Headers:

None