Check for array before iterating.