aboutsummaryrefslogtreecommitdiff
path: root/bucket.go
diff options
context:
space:
mode:
Diffstat (limited to 'bucket.go')
-rw-r--r--bucket.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/bucket.go b/bucket.go
index 28832fc..470689b 100644
--- a/bucket.go
+++ b/bucket.go
@@ -332,6 +332,12 @@ func (b *Bucket) NextSequence() (uint64, error) {
return 0, ErrTxNotWritable
}
+ // Materialize the root node if it hasn't been already so that the
+ // bucket will be saved during commit.
+ if b.rootNode == nil {
+ _ = b.node(b.root, nil)
+ }
+
// Increment and return the sequence.
b.bucket.sequence++
return b.bucket.sequence, nil