mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-09-20 13:37:31 -07:00
fix(battery): skip nil value batteries
This commit is contained in:
parent
3f2b89f475
commit
e1be81e658
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue