Fix panic when len(result[1]) == 0

This commit is contained in:
David Howden 2015-05-24 13:13:32 +10:00
parent 47d9285956
commit 2cbec0cf93

View File

@ -79,7 +79,10 @@ func dataSplit(b []byte, enc byte) ([][]byte, error) {
result := bytes.SplitN(b, delim, 2)
if len(result) != 2 {
return result, nil
}
if len(result[1]) == 0 {
return result, nil
}