NoMethodError in Web#web_product

Showing /var/www/vhosts/lolitamoda.com/lolitamodav7/app/views/web/web_product.html.erb where line #48 raised:

undefined method `image' for nil:NilClass

Extracted source (around line #48):

45
46
47
48
49
50
51
          
end
if WebConfig.first.web_url.include?("www")
photo = "https://#{WebConfig.first.web_url}#{@product.photos.first.image.url}"
else
photo = "https://www.#{WebConfig.first.web_url}#{@product.photos.first.image.url}"
end

Rails.root: /var/www/vhosts/lolitamoda.com/lolitamodav7

Application Trace | Framework Trace | Full Trace
app/views/web/web_product.html.erb:48:in `_app_views_web_web_product_html_erb__1643764045291482863_47314416387800'

Request

Parameters:

{"id"=>"2548-polo-pepe-jeans-bernard-azul"}

Response

Headers:

None