j6s / mailcow-exporter

MIT License
58 stars 12 forks source link

fix panic by handling error message #12

Closed alexandrepossebom closed 2 years ago

alexandrepossebom commented 2 years ago

This PR for addressing panic message below:

2022/09/03 09:15:13 http: panic serving [::1]:50741: runtime error: invalid memory address or nil pointer dereference
goroutine 146 [running]:
net/http.(*conn).serve.func1()
    /opt/homebrew/Cellar/go/1.19/libexec/src/net/http/server.go:1850 +0xb0
panic({0x100c77440, 0x100fb0230})
j6s commented 2 years ago

I must have forgotten to handle err there. Thank you for this PR