From 65b1daa52c26b259bcdda86cc73dbf061a669961 Mon Sep 17 00:00:00 2001
From: Alexander Lazarenko <kerblif@unprism.ru>
Date: Sat, 10 May 2025 14:07:12 +0300
Subject: [PATCH] Bug fix

---
 api.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/api.go b/api.go
index 1cb8651..267365e 100644
--- a/api.go
+++ b/api.go
@@ -134,6 +134,10 @@ func (a *Agate) SaveSnapshot(ctx context.Context, name string, parentID string)
 	}
 
 	// If parentID is not provided, use the current snapshot ID
+	if parentID == "" {
+		parentID = a.currentSnapshotID
+	}
+
 	effectiveParentID := parentID
 
 	// Create the snapshot