ensure we have an array before trying to iterate over it
line ending cleanup