How do I display a metafield property only if the field is filled, else hide it?

This code snippet should display the metafield only if the field is filled.

{%- if line_item.properties != empty -%}
<ul class="CartItem__PropertyList">
{%- for property in line_item.properties -%}
{%- assign first_character_in_key = property.first | truncate: 1, '' -%}
{%- if property.last == blank or first_character_in_key == '_' -%}
{%- continue -%}
{%- endif -%}
<p class="CartItem__Variant">Ringgröße: {{ property.last }}</p>
{%- endfor -%}
</ul>