1
0
Fork 0
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:
Patrick Ziegler 2020-12-05 22:58:38 +01:00 committed by GitHub
parent b2c515c73c
commit 82ebad5e7a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 23 additions and 9 deletions

View file

@ -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});