diff --git a/macaroons/store.go b/macaroons/store.go index b17a31150..a37b24d29 100644 --- a/macaroons/store.go +++ b/macaroons/store.go @@ -196,6 +196,8 @@ func (r *RootKeyStorage) RootKey(_ context.Context) ([]byte, []byte, error) { // Close closes the underlying database and zeroes the encryption key stored // in memory. func (r *RootKeyStorage) Close() error { - r.encKey.Zero() + if r.encKey != nil { + r.encKey.Zero() + } return r.DB.Close() }