Getting error in template: Impossible to access an attribute ("getUrl") on a NULL variable ("") This was working fine previously and not sure what triggered the error. Any idea how to resolve issue?

{% for block in entry.servicesItems.type('images') %}
    &lt;div class="col"&gt;

        {# grab the first image #}
        {% set image = block.image.first() %}

        {# link to the full sized version #}
            &lt;a href="{{ image.getUrl }}"&gt;
        {# generated the transformed thumbnail version #}
            &lt;img src="{{ image.getUrl('servicesImageCrop')}}" alt="{{ block.alt }}" width="{{ image.getWidth('servicesImageCrop') }}" height="{{ image.getHeight('servicesImageCrop') }}"&gt;
            &lt;div id="lightbox-title"&gt;
                &lt;h2&gt;{{ block.imageTitle }}&lt;/h2&gt;
                &lt;p&gt;{{ block.imageContent }}&lt;/p&gt;
            &lt;/div&gt;
        &lt;/a&gt;
    &lt;/div&gt;
{% endfor %}
You can just test if image is defined first using:

{% set image = block.image.first() %}
{% if image %}
    &lt;a href="{{ image.getUrl() }}"&gt;...&lt;/a&gt;
{% endif %}