mirror of
https://github.com/polybar/polybar.git
synced 2025-06-30 18:52:47 -04:00
fix(timer_module): Ensure that interval > 0 (#2274)
Since 3.5.0, we use m_interval for a modulo operation, this crashes the bar if the interval is 0. A non-positive interval shouldn't be allowed anyway, so we now throw an exception in that case. Fixes #2273
This commit is contained in:
parent
b2c515c73c
commit
82ebad5e7a
9 changed files with 23 additions and 9 deletions
|
@ -23,7 +23,7 @@ namespace modules {
|
|||
m_api_url += '/';
|
||||
}
|
||||
|
||||
m_interval = m_conf.get<decltype(m_interval)>(name(), "interval", 60s);
|
||||
set_interval(60s);
|
||||
m_empty_notifications = m_conf.get(name(), "empty-notifications", m_empty_notifications);
|
||||
|
||||
m_formatter->add(DEFAULT_FORMAT, TAG_LABEL, {TAG_LABEL});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue