From a5ce1bb265a0d1d961ab7c6563e007bc2d46a0c7 Mon Sep 17 00:00:00 2001 From: Robin Davies Date: Fri, 18 Oct 2024 05:09:02 -0400 Subject: [PATCH] Don't crash when running in a context without a home path. --- src/Storage.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Storage.cpp b/src/Storage.cpp index 49fabcb..92f49cc 100644 --- a/src/Storage.cpp +++ b/src/Storage.cpp @@ -150,6 +150,9 @@ std::filesystem::path ResolveHomePath(const std::filesystem::path &path) { homeDirectory = getenv("USERPROFILE"); } + if (homeDirectory == nullptr) { + return path; + } std::filesystem::path result = homeDirectory; bool first = true;