NoMethodError in Web#web_product

Showing /var/www/vhosts/yourwaystore.es/yourwaystore/app/views/web/menu/_product_schema.html.erb where line #6 raised:

undefined method `image' for nil:NilClass

Extracted source (around line #6):

3
4
5
6
7
8
9
          
"@context": "https://schema.org/",
"@type": "Product",
"name": "<%= product.name %>",
"image": "https://<%= WebConfig.first.web_url %><%= product.photos.order(:position).first.image %>",
"description": "<%=product.description %>",
"brand": "<%= product.brand_name %>",
"offers": {

Trace of template inclusion: app/views/web/web_product.html.erb

Rails.root: /var/www/vhosts/yourwaystore.es/yourwaystore

Application Trace | Framework Trace | Full Trace
app/views/web/menu/_product_schema.html.erb:6:in `_app_views_web_menu__product_schema_html_erb___3758975883477384049_69986831782320'
app/views/web/web_product.html.erb:1:in `_app_views_web_web_product_html_erb__2150219497996547494_69986833527360'

Request

Parameters:

{"id"=>"1777-cinturon-dickies-orcutt"}

Response

Headers:

None