1
0
Fork 0
mirror of https://github.com/polybar/polybar.git synced 2024-12-16 14:17:24 -05:00

fix: Terminate if there are no configured modules

This commit is contained in:
Michael Carlberg 2016-10-15 13:10:08 +02:00
parent 98b5bae096
commit ce93a63cb8

View file

@ -353,6 +353,8 @@ class controller {
m_modules.emplace(alignment::CENTER, vector<module_t>{});
m_modules.emplace(alignment::RIGHT, vector<module_t>{});
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) {