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

Check response from doHTTPGet() before use #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RichieB2B
Copy link

The response from doHTTPGet() needs to be checked before using it. Otherwise this can occur:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x70cc11]

goroutine 58627 [running]:
github.com/exzz/netatmo-api-go.processHTTPResponse(0x0, 0xa06d00, 0xc000468030, 0x8d3820, 0xc0004f6d80, 0x0, 0x0)
        /go/pkg/mod/github.com/exzz/netatmo-api-go@v0.0.0-20171026152754-41589231f446/weather.go:176 +0x41
github.com/exzz/netatmo-api-go.(*Client).Read(0xc0004f6d60, 0x5fbc6114, 0x245cb11f, 0x312f8772ba9ba6)
        /go/pkg/mod/github.com/exzz/netatmo-api-go@v0.0.0-20171026152754-41589231f446/weather.go:204 +0x16a

Please check my syntax. I am not a Go programmer.

@RichieB2B RichieB2B force-pushed the doHTTPGet_nil_pointer branch from c450f3e to 82b755e Compare November 14, 2022 12:49
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

Successfully merging this pull request may close these issues.

1 participant