fixed early dereference error
This commit is contained in:
parent
dacffdb095
commit
d14a4a2b1a
|
@ -701,7 +701,6 @@ void waybar::modules::Battery::setBarClass(std::string& state) {
|
|||
return classname.rfind(prefix, 0) == 0;
|
||||
});
|
||||
|
||||
auto old_class = *old_class_it;
|
||||
auto new_class = prefix + state;
|
||||
|
||||
// If the bar doesn't have any `battery-` class
|
||||
|
@ -712,6 +711,8 @@ void waybar::modules::Battery::setBarClass(std::string& state) {
|
|||
return;
|
||||
}
|
||||
|
||||
auto old_class = *old_class_it;
|
||||
|
||||
// If the bar has a `battery-` class,
|
||||
// but `state` is empty
|
||||
if(state.empty()) {
|
||||
|
|
Loading…
Reference in New Issue