diff --git a/plugins/window-rules/window-rules.cpp b/plugins/window-rules/window-rules.cpp index b79ee36a7..07878df24 100644 --- a/plugins/window-rules/window-rules.cpp +++ b/plugins/window-rules/window-rules.cpp @@ -187,11 +187,20 @@ void wayfire_window_rules_t::setup_rules_from_config() for (const auto& [name, rule_str] : rule_list) { LOGD("Registering ", rule_str); - _lexer.reset(rule_str); - auto rule = wf::rule_parser_t().parse(_lexer); - if (rule != nullptr) - { + try { + _lexer.reset(rule_str); + auto rule = wf::rule_parser_t().parse(_lexer); + + if (rule == nullptr) + { + LOGW("Failed to parse rule: ", rule_str); + continue; + } + _rules.push_back(rule); + } catch (const std::exception& e) + { + LOGE("Error parsing rule: ", rule_str, " Exception: ", e.what()); } } }