Handle variant 0 ("none") in CompactSequences.
authorTom Clegg <tom@tomclegg.ca>
Mon, 19 Oct 2020 15:01:58 +0000 (11:01 -0400)
committerTom Clegg <tom@tomclegg.ca>
Mon, 19 Oct 2020 15:01:58 +0000 (11:01 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@tomclegg.ca>

tilelib.go

index 8be8eb46cf02069de9fa4dcc7c1ae40988c89e85..403be31c7babfb0d9aeb9104312dbe836282a19e 100644 (file)
@@ -163,6 +163,12 @@ func (tilelib *tileLibrary) loadCompactSequences(cseqs []CompactSequence, varian
        for _, cseq := range cseqs {
                for _, tseq := range cseq.TileSequences {
                        for i, libref := range tseq {
+                               if libref.Variant == 0 {
+                                       // No variant (e.g., import
+                                       // dropped tiles with
+                                       // no-calls) = no translation.
+                                       continue
+                               }
                                v, ok := variantmap[libref]
                                if !ok {
                                        return fmt.Errorf("oops: CompactSequence %q has variant %d for tag %d, but that variant was not in its library", cseq.Name, libref.Variant, libref.Tag)