From 52041829137b417d53e43f67bb18b14a3b8a472e Mon Sep 17 00:00:00 2001 From: Toni Spets Date: Thu, 25 Jan 2024 13:58:21 +0200 Subject: [PATCH] Fail checkpoint if no generation exists --- db.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/db.go b/db.go index bfe5fe46..bb015c06 100644 --- a/db.go +++ b/db.go @@ -1301,7 +1301,10 @@ func (db *DB) Checkpoint(ctx context.Context, mode string) (err error) { generation, err := db.CurrentGeneration() if err != nil { return fmt.Errorf("cannot determine generation: %w", err) + } else if generation == "" { + return fmt.Errorf("no current generation") } + return db.checkpoint(ctx, generation, mode) }