diff --git a/include/components/controller.hpp b/include/components/controller.hpp index db5a2ace..d22d0e5d 100644 --- a/include/components/controller.hpp +++ b/include/components/controller.hpp @@ -353,6 +353,8 @@ class controller { m_modules.emplace(alignment::CENTER, vector{}); m_modules.emplace(alignment::RIGHT, vector{}); + size_t module_count = 0; + for (auto& block : m_modules) { string bs{m_conf.bar_section()}; string confkey; @@ -406,8 +408,13 @@ class controller { modules.emplace_back(new menu_module(bar, m_log, m_conf, module_name)); else throw application_error("Unknown module: " + module_name); + + module_count++; } } + + if (module_count == 0) + throw application_error("No modules created"); } void on_module_update(string module_name) {