Twig\Error\RuntimeError

Line 15 of /home/clients/118fb10a9770004be21b58edaf37f4c7/sites/labrigeneve.ch/site/templates/artistes.twig

Impossible to invoke a method ("crop") on a null variable.

            {% set selectedSeason = get('season') ? get('season') : currentSeason %}
            {% set backgrounds = page.structure_background.toStructure().filterBy('saison', selectedSeason) %}
            {% for background in backgrounds %}
                {% if background.saison == selectedSeason %}
                    <style>
                        .bg::after {
                            background: url({{ background.background.toFile().crop(950).url() }}) no-repeat center center;
                            background-size: cover;
                        }
                    </style>
                {% endif %}
            {% endfor %}
            {% include '@snippets/navigation-years.twig' with {'elements': page.children().listed(), 'selectedSeason': selectedSeason} %}