From b639a6aef932e355b694810280c6ba484988051a Mon Sep 17 00:00:00 2001
From: Mikhail Mineev <Mikhail.Mineev@cern.ch>
Date: Tue, 10 Sep 2024 13:42:45 +0200
Subject: [PATCH] fixed a bug, when CREST server ULR is an empty string

---
 src/CrestApiFs.cxx | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/CrestApiFs.cxx b/src/CrestApiFs.cxx
index e014606..593cac6 100644
--- a/src/CrestApiFs.cxx
+++ b/src/CrestApiFs.cxx
@@ -34,6 +34,10 @@ namespace Crest
   CrestFsClient::CrestFsClient(bool rewriteIfExists, const std::string &root_folder)
       : m_root_folder(root_folder), m_isRewrite(rewriteIfExists)
   {
+    if (m_root_folder == "") {
+      m_root_folder = std::filesystem::current_path();
+      m_root_folder += "/crest";
+    }
     if (!std::filesystem::exists(std::filesystem::path(m_root_folder)))
     {
       std::filesystem::create_directory(std::filesystem::path(m_root_folder));
-- 
GitLab