From 4b354414f413b531b70dc8859500efba5fbdd5b8 Mon Sep 17 00:00:00 2001 From: Nate Maninger Date: Wed, 11 Sep 2024 11:58:11 -0700 Subject: [PATCH] sqlite: check for empty destPath --- persist/sqlite/store.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/persist/sqlite/store.go b/persist/sqlite/store.go index f8e2a7cb..657e9699 100644 --- a/persist/sqlite/store.go +++ b/persist/sqlite/store.go @@ -177,6 +177,8 @@ func (s *Store) Backup(ctx context.Context, destPath string) (err error) { // prevent overwriting the destination file if _, err := os.Stat(destPath); !errors.Is(err, os.ErrNotExist) { return errors.New("destination file already exists") + } else if len(destPath) == 0 { + return errors.New("empty destination path") } // create the destination database