Fix panic on blank line in fasta.
authorTom Clegg <tom@tomclegg.ca>
Wed, 2 Sep 2020 04:04:43 +0000 (00:04 -0400)
committerTom Clegg <tom@tomclegg.ca>
Wed, 2 Sep 2020 04:04:43 +0000 (00:04 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@tomclegg.ca>

tilelib.go

index e87a1f46fc1a01237d8da3e888c91d02244e0ca7..49f5169665bbd19f433cf1d2da63a9313d7fde94 100644 (file)
@@ -69,7 +69,7 @@ func (tilelib *tileLibrary) TileFasta(filelabel string, rdr io.Reader) (tileSeq,
                var seqlabel string
                for scanner.Scan() {
                        buf := scanner.Bytes()
-                       if len(buf) == 0 || buf[0] == '>' {
+                       if len(buf) > 0 && buf[0] == '>' {
                                todo <- jobT{seqlabel, fasta}
                                seqlabel, fasta = string(buf[1:]), nil
                                log.Debugf("%s %s reading fasta", filelabel, seqlabel)