From 24aba14541ea53425713ea08855244ab8ecf177e Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Sat, 24 Dec 2016 05:29:04 +0100 Subject: [PATCH] fix(battery): Safety check Refs #269 --- src/modules/battery.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/battery.cpp b/src/modules/battery.cpp index f8be74ad..c1f3522b 100644 --- a/src/modules/battery.cpp +++ b/src/modules/battery.cpp @@ -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()); }