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___693368018230193181_69880109857220'
app/views/web/web_subcategory.html.erb:179:in `_app_views_web_web_subcategory_html_erb__3846749286711270205_69880223404280'

Request

Parameters:

{"brand"=>"ALPHA INDUSTRIES",
 "id"=>"1-mujer"}

Response

Headers:

None