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

Got panic sometime #3

Open
vincent-tr opened this issue Dec 4, 2023 · 0 comments
Open

Got panic sometime #3

vincent-tr opened this issue Dec 4, 2023 · 0 comments

Comments

@vincent-tr
Copy link

Hello,

Sometime I get this panic:

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

goroutine 2374 [running]:
[github.com/sgrimee/kizcool.(*Kiz).PollEvents(0x4000f99da0](http://github.com/sgrimee/kizcool.(*Kiz).PollEvents(0x4000f99da0)?)
        /root/go/pkg/mod/[github.com/sgrimee/[email protected]/kizcool.go:265](http://github.com/sgrimee/[email protected]/kizcool.go:265) +0x90
...

After reading the code:
I see that in DoWithAuth function, at the first c.hc.Do(req) we check the result with checkStatusOk.
After the second call, if a Login occured, we do not.
And actually checkStatusOk ensure that there is a response Body.
(note that addr=0x40 correspond to the offset of Body in http.Response structure).

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

1 participant