mirror of
https://github.com/rad4day/Waybar.git
synced 2025-07-13 14:42:29 +02:00
fixed early dereference error
This commit is contained in:
@ -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()) {
|
||||
|
Reference in New Issue
Block a user