Allow saving snapshot without package refs loaded. #63

This commit is contained in:
Andrey Smirnov
2014-07-26 17:09:47 +04:00
parent bd221bf869
commit d7ef1a0c4b
+4 -1
View File
@@ -178,7 +178,10 @@ func (collection *SnapshotCollection) Update(snapshot *Snapshot) error {
if err != nil {
return err
}
return collection.db.Put(snapshot.RefKey(), snapshot.packageRefs.Encode())
if snapshot.packageRefs != nil {
return collection.db.Put(snapshot.RefKey(), snapshot.packageRefs.Encode())
}
return nil
}
// LoadComplete loads additional information about snapshot