Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashes when trying to get battery state of mac mini #8

Open
wormiedk opened this issue Feb 23, 2022 · 2 comments
Open

Crashes when trying to get battery state of mac mini #8

wormiedk opened this issue Feb 23, 2022 · 2 comments

Comments

@wormiedk
Copy link

panic: runtime error: index out of range [1] with length 0

goroutine 32 [running]:
main.getBatteryChargePercent(0xc000049ef0, 0x1319948)
        /Users/bessarabov/Dropbox/git/mac2mqtt/mac2mqtt.go:284 +0x115
main.updateBattery(0x137cc20, 0xc000198000)
        /Users/bessarabov/Dropbox/git/mac2mqtt/mac2mqtt.go:290 +0x85
main.main.func1(0xc00013a370, 0x137cc20, 0xc000198000, 0xc00013a3c0)
        /Users/bessarabov/Dropbox/git/mac2mqtt/mac2mqtt.go:318 +0xe5
created by main.main
        /Users/bessarabov/Dropbox/git/mac2mqtt/mac2mqtt.go:310 +0x1d0

@balzreber
Copy link

same error here

@callumgare
Copy link

This can be fixed using this PR #17 and building a new binary by following the process in #9. Hopefully these changes will be merged soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants