#Invalid pointer reference at struct function param call?
17 messages · Page 1 of 1 (latest)
Can you paste the whole error instead of screenshot?
This also just means that the error is inside SlashCommandHandler
2023/05/22 21:33:22 http: panic serving 127.0.0.1:50399: runtime error: invalid memory address or nil pointer dereference
goroutine 18 [running]:
net/http.(*conn).serve.func1()
C:/Program Files/Go/src/net/http/server.go:1854 +0xbf
panic({0x491480, 0x74bc90})
C:/Program Files/Go/src/runtime/panic.go:890 +0x263
example-bot/command.glob..func3({0xf688a065ac4408c, 0xf182cda41443064, 0x2, {0xf5f180ad704100d, {0xc0000f0000, 0x7}, 0x1, 0x0, {0x0, 0x0, ...}, ...}, ...})
C:/Users/Krzys/Documents/Tempest/example/command/dynamic.go:49 +0x36c
github.com/Amatsagu/Tempest.(*Client).handleRequest(0xc000156090, {0x573d20, 0xc0000b4000}, 0xc00009a000)
C:/Users/Krzys/go/pkg/mod/github.com/!amatsagu/!tempest@v1.0.6-0.20230522105704-64851e45af94/client-internal-handler.go:65 +0x575
net/http.HandlerFunc.ServeHTTP(0xc0000b4000?, {0x573d20?, 0xc0000b4000?}, 0xc0000a4048?)
C:/Program Files/Go/src/net/http/server.go:2122 +0x2f
net/http.(*ServeMux).ServeHTTP(0x0?, {0x573d20, 0xc0000b4000}, 0xc00009a000)
C:/Program Files/Go/src/net/http/server.go:2500 +0x149
net/http.serverHandler.ServeHTTP({0x572ec0?}, {0x573d20, 0xc0000b4000}, 0xc00009a000)
C:/Program Files/Go/src/net/http/server.go:2936 +0x316
net/http.(*conn).serve(0xc000248000, {0x573fd8, 0xc000236150})
C:/Program Files/Go/src/net/http/server.go:1995 +0x612
created by net/http.(*Server).Serve
C:/Program Files/Go/src/net/http/server.go:3089 +0x5ed
All it does is calling client's method to await component but error doesn't point on that line...
It either replies to message or creates channel
It stops working when both are active
And it throws no error message which is weird
Line 32 - to send reply to command interaction, this works only when 38-47 lines are commented (disabled)
With Client#AwaitComponent thing, it stops responding to command and neither throws error
I commented latest lib code here ^
That channel has timeout on itself which seems to work just fine:
I tried running debugger and it looks like for whatever reason - code at 32nd line doesn't run but neither shows errors, it's just skipped entirely, then it goes to await component that works fine.
Ok