Check if the extra name is != None before trying to check the length
{%- endfor -%}
{#- append all the names/IPs provided (if not empty) -#}
{%- for name in lst -%}
- {%- if name|length > 0 -%}
+ {%- if name and name|length > 0 -%}
{%- if salt['caasp_filters.is_ip'](name) -%}
{%- do altNames.append("IP: " + name) -%}
{%- else -%}
