Empty Image Evaluates to True

Shopify Expert
19 0 3

I am fetching an image by its handle.

 

{% assign my_image = images['my_handle'] %}

Then I want to conditionally display the image.

 

{% if my_image %}

.... do something

{% endif %}

 

But, if the image doesn't exist and all we have is an EmptyDrop, it still passes the if statement.

 

Shouldn't an EmptyDrop evaluate to false?

 

 

0 Likes