Skip empty lines in the CSV file

This commit is contained in:
Frank Denis 2018-01-13 23:53:33 +01:00
parent a361aa52f3
commit 13e30ade2b
1 changed files with 3 additions and 0 deletions

View File

@ -131,6 +131,9 @@ func (source *Source) Parse() ([]RegisteredServer, error) {
return registeredServers, nil
}
for line, record := range records {
if len(record) == 0 {
continue
}
if len(record) < 14 {
return registeredServers, fmt.Errorf("Parse error at line %d", line)
}