1
0
Fork 0
mirror of https://github.com/polybar/polybar.git synced 2024-11-11 13:50:56 -05:00

fix(battery): Safety check

Refs #269
This commit is contained in:
Michael Carlberg 2016-12-24 05:29:04 +01:00
parent 85c915d35b
commit 24aba14541

View file

@ -101,7 +101,7 @@ namespace modules {
watch(m_valuepath[battery_module::value::ADAPTER], IN_ACCESS);
// Setup time if token is used
if (m_label_charging->has_token("%time%") || m_label_discharging->has_token("%time%")) {
if ((m_label_charging && m_label_charging->has_token("%time%")) || (m_label_discharging && m_label_discharging->has_token("%time%"))) {
if (!m_bar.locale.empty()) {
setlocale(LC_TIME, m_bar.locale.c_str());
}