diff --git a/archiver.go b/archiver.go index 5621345dd..c472a0eeb 100644 --- a/archiver.go +++ b/archiver.go @@ -334,6 +334,10 @@ func (arch *Archiver) dirWorker(wg *sync.WaitGroup, p *Progress, done <-chan str if node.Type == "dir" { debug.Log("Archiver.dirWorker", "got tree node for %s: %v", node.path, node.blobs) + + if node.Subtree.IsNull() { + panic("invalid null subtree ID") + } } } @@ -359,6 +363,9 @@ func (arch *Archiver) dirWorker(wg *sync.WaitGroup, p *Progress, done <-chan str panic(err) } debug.Log("Archiver.dirWorker", "save tree for %s: %v", dir.Path(), id.Str()) + if id.IsNull() { + panic("invalid null subtree ID return from SaveTreeJSON()") + } node.Subtree = &id diff --git a/repository/index.go b/repository/index.go index 39152e6a5..863388b60 100644 --- a/repository/index.go +++ b/repository/index.go @@ -215,6 +215,10 @@ func (idx *Index) generatePackList(selectFn func(indexEntry) bool) ([]*packJSON, packs := make(map[backend.ID]*packJSON) for id, blob := range idx.pack { + if blob.packID == nil { + panic("nil pack id") + } + if selectFn != nil && !selectFn(blob) { continue }