Twig\Error\RuntimeError

Line 8 of /home/simavi/domains/simavi.nl/releases/8/site/snippets/content-blocks/_image.twig

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


{% block content %}
    {% import '@snippets/macro.twig' as macro %}

    {% set image = block.content.image.toFile() %}
    <section class="c-block c-block--image" id="{{ block.anchor | default('') }}">
        {% if image.orientation() == 'landscape' %}
            <div class="container u-contain">
                <figure>
                    {{ macro.picture(image, 1200) }}
                    {% if block.content.caption.isNotEmpty() %}
                        <figcaption class="u-border-left">{{ block.content.caption }}</figcaption>
                    {% endif %}