diff options
author | vaxerski <[email protected]> | 2023-10-05 16:57:54 +0100 |
---|---|---|
committer | vaxerski <[email protected]> | 2023-10-05 16:57:54 +0100 |
commit | 24c04a8b7c874ead168bb2418f4325cb8bdaca5b (patch) | |
tree | 85f996e63dae4dcba64fe46593115f3540c2d5ff | |
parent | 3d1a1679604e9de18a46a9a0819daf2044b08fa6 (diff) | |
download | Hyprland-24c04a8b7c874ead168bb2418f4325cb8bdaca5b.tar.gz Hyprland-24c04a8b7c874ead168bb2418f4325cb8bdaca5b.zip |
crashreporter: avoid using empty CACHE_HOME
-rw-r--r-- | src/debug/CrashReporter.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/debug/CrashReporter.cpp b/src/debug/CrashReporter.cpp index ed4357d2..1a28a780 100644 --- a/src/debug/CrashReporter.cpp +++ b/src/debug/CrashReporter.cpp @@ -130,7 +130,7 @@ void CrashReporter::createAndSaveCrash(int sig) { std::ofstream ofs; std::string path; - if (!CACHE_HOME) { + if (!CACHE_HOME || std::string(CACHE_HOME).empty()) { if (!std::filesystem::exists(std::string(HOME) + "/.hyprland")) { std::filesystem::create_directory(std::string(HOME) + "/.hyprland"); std::filesystem::permissions(std::string(HOME) + "/.hyprland", std::filesystem::perms::all, std::filesystem::perm_options::replace); @@ -139,7 +139,7 @@ void CrashReporter::createAndSaveCrash(int sig) { path = std::string(HOME) + "/.hyprland/hyprlandCrashReport" + std::to_string(PID) + ".txt"; ofs.open(path, std::ios::trunc); - } else if (CACHE_HOME) { + } else { if (!std::filesystem::exists(std::string(CACHE_HOME) + "/hyprland")) { std::filesystem::create_directory(std::string(CACHE_HOME) + "/hyprland"); std::filesystem::permissions(std::string(CACHE_HOME) + "/hyprland", std::filesystem::perms::all, std::filesystem::perm_options::replace); @@ -147,8 +147,6 @@ void CrashReporter::createAndSaveCrash(int sig) { path = std::string(CACHE_HOME) + "/hyprland/hyprlandCrashReport" + std::to_string(PID) + ".txt"; ofs.open(path, std::ios::trunc); - } else { - return; } ofs << finalCrashReport; |