You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looks like for some reason the application isn't being loaded correctly, and we assume that the application is always there. I think we can add a check to see if the app != nil in https://github.com/vishen/go-chromecast/blob/master/http/types.go#L49 before trying to map data from it.
I enabled the httpserver, then requested connect then status:
POST http://192.168.20.16:8011/connect?uuid=123456...
POST http://192.168.20.16:8011/status?uuid=123456...
$ go-chromecast httpserver
INFO[0000] starting http server on 0.0.0.0:8011
2024/02/13 13:31:00 http: panic serving 192.168.20.38:23608: runtime error: invalid memory address or nil pointer dereference
goroutine 33 [running]:
net/http.(*conn).serve.func1()
/opt/hostedtoolcache/go/1.19.8/x64/src/net/http/server.go:1850 +0xb8
panic({0x67d2a0, 0xcd9ad0})
/opt/hostedtoolcache/go/1.19.8/x64/src/runtime/panic.go:890 +0x260
github.com/vishen/go-chromecast/http.fromApplicationStatus(_, _, _)
/home/runner/work/go-chromecast/go-chromecast/http/types.go:49 +0x58
github.com/vishen/go-chromecast/http.(*Handler).status(0x40001259e0, {0x871f20?, 0x40005260e0}, 0x0?)
/home/runner/work/go-chromecast/go-chromecast/http/handlers.go:276 +0x94
net/http.HandlerFunc.ServeHTTP(0x400015430d?, {0x871f20?, 0x40005260e0?}, 0xffffffffffffffff?)
/opt/hostedtoolcache/go/1.19.8/x64/src/net/http/server.go:2109 +0x38
net/http.(*ServeMux).ServeHTTP(0xa9020?, {0x871f20, 0x40005260e0}, 0x4000194100)
/opt/hostedtoolcache/go/1.19.8/x64/src/net/http/server.go:2487 +0x140
github.com/vishen/go-chromecast/http.(*Handler).ServeHTTP(0x400015430d?, {0x871f20?, 0x40005260e0?}, 0x2e16e8?)
/home/runner/work/go-chromecast/go-chromecast/http/handlers.go:38 +0x28
net/http.serverHandler.ServeHTTP({0x400007c630?}, {0x871f20, 0x40005260e0}, 0x4000194100)
/opt/hostedtoolcache/go/1.19.8/x64/src/net/http/server.go:2947 +0x2cc
net/http.(*conn).serve(0x40000ce140, {0x872920, 0x40003debd0})
/opt/hostedtoolcache/go/1.19.8/x64/src/net/http/server.go:1991 +0x544
created by net/http.(*Server).Serve
/opt/hostedtoolcache/go/1.19.8/x64/src/net/http/server.go:3102 +0x43c
The text was updated successfully, but these errors were encountered: