From d7ef1a0c4b768be67f487c7fa546f733bf708049 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Sat, 26 Jul 2014 17:09:47 +0400 Subject: [PATCH] Allow saving snapshot without package refs loaded. #63 --- deb/snapshot.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/deb/snapshot.go b/deb/snapshot.go index 52bfa7f1..fba75b88 100644 --- a/deb/snapshot.go +++ b/deb/snapshot.go @@ -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