Skip to content

Commit

Permalink
Fixes #134, caused by a divide by zero error on systems with no batte…
Browse files Browse the repository at this point in the history
…ries
  • Loading branch information
xxxserxxx committed Jun 23, 2020
1 parent 0b463d4 commit 050b62a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions widgets/batterygauge.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ func (b *BatteryGauge) update() {
}
return
}
if len(bats) < 1 {
b.Label = fmt.Sprintf("N/A")
return
}
mx := 0.0
cu := 0.0
charging := "%d%% ⚡%s"
Expand Down

0 comments on commit 050b62a

Please sign in to comment.