aboutsummaryrefslogtreecommitdiffhomepage
path: root/hyprctl/main.cpp
diff options
context:
space:
mode:
authorVaxry <[email protected]>2024-11-25 14:42:06 +0000
committerVaxry <[email protected]>2024-11-25 14:42:11 +0000
commit268778823676ef2bbda42050d78946e1fc27fc31 (patch)
tree6772fc7da6bc1d5b9930e78afd5e47208209b26e /hyprctl/main.cpp
parent0ddb952d7a3d102e160eea93c68f0d366186cf73 (diff)
downloadHyprland-268778823676ef2bbda42050d78946e1fc27fc31.tar.gz
Hyprland-268778823676ef2bbda42050d78946e1fc27fc31.zip
hyprctl: verify runtime dir exists in instances()
ref #8579
Diffstat (limited to 'hyprctl/main.cpp')
-rw-r--r--hyprctl/main.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/hyprctl/main.cpp b/hyprctl/main.cpp
index 1f7f8d74..4ee2d598 100644
--- a/hyprctl/main.cpp
+++ b/hyprctl/main.cpp
@@ -66,6 +66,11 @@ std::string getRuntimeDir() {
std::vector<SInstanceData> instances() {
std::vector<SInstanceData> result;
+ try {
+ if (!std::filesystem::exists(getRuntimeDir()))
+ return {};
+ } catch (std::exception& e) { return {}; }
+
for (const auto& el : std::filesystem::directory_iterator(getRuntimeDir())) {
if (!el.is_directory() || !std::filesystem::exists(el.path().string() + "/hyprland.lock"))
continue;