NoMethodError in CompanyController#multi_show

undefined method `category' for nil:NilClass

Extracted source (around line #246):
244
245
246
247
248
249
              
@brand = Brand.where(slug: brand).first
@cat = Category.where(id: @brand.category.id).first
#Burası Alfabetik linkleri oluşturmak için
@comp = Company.where(brand_id: @brand.id).where(category_id: @cat.id)

Rails.root: /home/lwt

Application Trace | Framework Trace | Full Trace

Request

Parameters:

{"brand"=>"second-hands", "id"=>"st-augustine-s-car-boot-sale"}

Response

Headers:

None