diff --git a/lib/modder/modder_write.go b/lib/modder/modder_write.go index 5c7a8fb..85d652e 100644 --- a/lib/modder/modder_write.go +++ b/lib/modder/modder_write.go @@ -57,6 +57,9 @@ func (mdr *Modder) WriteVendor() error { Path: strings.Join([]string{m.Module}, "/"), Version: m.Version, } + if mdr.module.SumFile == nil { + mdr.module.SumFile = &sumfile.Sum{} + } mdr.module.SumFile.Add(dver, dirhash) mver := sumfile.Version{ diff --git a/lib/parse/sumfile/sumfile.go b/lib/parse/sumfile/sumfile.go index 5050796..aa36ac0 100644 --- a/lib/parse/sumfile/sumfile.go +++ b/lib/parse/sumfile/sumfile.go @@ -59,6 +59,9 @@ func ParseSum(data []byte, file string) (Sum, error) { } func (sum *Sum) Add(ver Version, hash string) { + if sum.Mods == nil { + sum.Mods = make(map[Version][]string) + } val, ok := sum.Mods[ver] if !ok { val = make([]string,0)