From 7447be822080fac5b8515a177773ec74b4d6c925 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Fri, 2 Feb 2024 01:51:14 +0000 Subject: [PATCH] hyprpm: fix crash on add plugin ref #4563 --- hyprpm/src/core/DataState.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hyprpm/src/core/DataState.cpp b/hyprpm/src/core/DataState.cpp index cf54ecc6..b6b34375 100644 --- a/hyprpm/src/core/DataState.cpp +++ b/hyprpm/src/core/DataState.cpp @@ -207,7 +207,10 @@ bool DataState::setPluginEnabled(const std::string& name, bool enabled) { const auto PATH = getDataStatePath(); for (const auto& entry : std::filesystem::directory_iterator(PATH)) { - if (!entry.is_directory()) + if (!entry.is_directory() || entry.path().stem() == "headersRoot") + continue; + + if (!std::filesystem::exists(entry.path().string() + "/state.toml")) continue; auto STATE = toml::parse_file(entry.path().string() + "/state.toml");