In the code given below
content.field_image_link[0]['#url']
is empty but it still enters the if condition and adds html
what is incorrect in the below code due to which it enters the if
condition whereas it should enter the second if condition given below
{% if content.field_image_link[0]['#url'] %}
{% block paragraph %}
<div{{ attributes.addClass(classes) }}>
{% block content %}
{% if content.field_image_link[0]['#url'] %}
<a href="{{ content.field_image_link[0]['#url'] }}">
{{ content.field_image_2 }}
</a>
<h2>
<a href="{{ content.field_image_link[0]['#url'] }}">
{{ content.field_image_link[0]['#title'] }}
</a>
</h2>
{% endif %}
{% if content.field_image_link[0]['#url'] == '' %}
{{ content.field_image_2 }}
<h2>
{{ content.field_image_link[0]['#title'] }}
</h2>
{% endif %}
{% endblock %}
</div>
{% endblock paragraph %}