From 7446a831fc454877f304c90c40ebe1f1acba98a7 Mon Sep 17 00:00:00 2001 From: almogbaku Date: Mon, 3 Mar 2025 15:26:32 +0200 Subject: [PATCH] fix: initialize DBKeys only if DBKeysURI is provided --- src/cmd/root.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/cmd/root.go b/src/cmd/root.go index f75498b..0780e8c 100644 --- a/src/cmd/root.go +++ b/src/cmd/root.go @@ -3,6 +3,7 @@ package cmd import ( "embed" "fmt" + "go.mau.fi/whatsmeow/store/sqlstore" "log" "net/http" "os" @@ -240,7 +241,11 @@ func runRest(_ *cobra.Command, _ []string) { } db := whatsapp.InitWaDB(config.DBURI) - dbKeys := whatsapp.InitWaDB(config.DBKeysURI) + var dbKeys *sqlstore.Container + if config.DBKeysURI != "" { + dbKeys = whatsapp.InitWaDB(config.DBKeysURI) + } + cli := whatsapp.InitWaCLI(db, dbKeys) // Service