From 5e34360d25ca4fc344a70e3a69761313e0787f50 Mon Sep 17 00:00:00 2001 From: dijunkun Date: Thu, 5 Nov 2026 16:25:05 +0800 Subject: [PATCH] [fix] handle relative cache paths during device identity initialization --- apps/desktop/src/common/private_file.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/desktop/src/common/private_file.cpp b/apps/desktop/src/common/private_file.cpp index 99b5aad2..b4460b6f 100644 --- a/apps/desktop/src/common/private_file.cpp +++ b/apps/desktop/src/common/private_file.cpp @@ -230,7 +230,10 @@ std::string Read(const std::filesystem::path& path) { } void EnsureDirectory(const std::filesystem::path& directory, bool protect_existing) { - std::filesystem::create_directories(directory.parent_path()); + const auto parent = directory.parent_path(); + if (!parent.empty()) { + std::filesystem::create_directories(parent); + } #ifdef _WIN32 CreatePrivateDirectory(directory, protect_existing); #else