NoMethodError in Web#web_subcategory

Showing /var/www/vhosts/lolitamoda.com/lolitamodav7/app/views/web/menu/_promotion_block.html.erb where line #7 raised:

undefined method `id' for nil:NilClass

Extracted source (around line #7):

4
5
6
7
8
9
10
          
<% if @category.parent.present? %>
<% BlockPromotion.where("(category_id = ? or category_id is NULL) and (brand_id = ? or brand_id is NULL )", @category.parent.parent.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:7: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"=>"Hilfiger Denim",
 "id"=>"89-polos-mujer"}

Response

Headers:

None