From 5663e1e2cef32a23430eed86469b889bdcfd99ab Mon Sep 17 00:00:00 2001 From: Craig Peterson Date: Wed, 23 Sep 2015 10:05:43 -0600 Subject: [PATCH] Fixing panic if bucket does not exist for restoreState --- cmd/bosun/sched/bolt.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/bosun/sched/bolt.go b/cmd/bosun/sched/bolt.go index a8983499ec..4580e1a012 100644 --- a/cmd/bosun/sched/bolt.go +++ b/cmd/bosun/sched/bolt.go @@ -315,6 +315,9 @@ func (s *Schedule) GetStateFileBackup() ([]byte, error) { func deleteKey(db *bolt.DB, name string) error { return db.Update(func(tx *bolt.Tx) error { b := tx.Bucket([]byte(dbBucket)) + if b == nil { + return fmt.Errorf("unknown bucket: %v", dbBucket) + } return b.Delete([]byte(name)) }) }