Skip to content

Commit

Permalink
fix(battery): skip nil value batteries
Browse files Browse the repository at this point in the history
  • Loading branch information
JanDeDobbeleer committed Sep 18, 2021
1 parent 3f2b89f commit e1be81e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/segment_battery.go
Expand Up @@ -48,6 +48,9 @@ func (b *batt) enabled() bool {

b.Battery = &battery.Battery{}
for _, bt := range batteries {
if bt == nil {
continue
}
b.Battery.Current += bt.Current
b.Battery.Full += bt.Full
b.Battery.State = b.mapMostLogicalState(b.Battery.State, bt.State)
Expand Down

0 comments on commit e1be81e

Please sign in to comment.