diff --git a/src/Bar.cpp b/src/Bar.cpp index 0f6052c..cbeb734 100644 --- a/src/Bar.cpp +++ b/src/Bar.cpp @@ -24,6 +24,7 @@ namespace Bar case Right: return Alignment::Right; case Center: return Alignment::Fill; } + return Alignment::Right; } TransitionType SideToDefaultTransition(Side side) @@ -94,13 +95,15 @@ namespace Bar if (isCharging && !wasCharging && sensor.Get() != nullptr) { sensor.AddClass("battery-charging"); - batteryText->AddClass("battery-charging"); + if (batteryText) + batteryText->AddClass("battery-charging"); wasCharging = true; } else if (!isCharging && wasCharging) { sensor.RemoveClass("battery-charging"); - batteryText->RemoveClass("battery-charging"); + if (batteryText) + batteryText->RemoveClass("battery-charging"); wasCharging = false; } return TimerResult::Ok;