Skip to content

[Bug]: response.ServerAddr() panics #543

@yaron12n

Description

@yaron12n

Description

Calling response.ServerAddr() causes a panic even though the response object is valid. This occurs when using playwright-go version v0.5001.0.

resp := page.Response()
// response is valid
addr := resp.ServerAddr() // <- panic occurs here

Stacktrace:

/usr/local/go/src/runtime/panic.go:792 +0x124
reflect.flag.mustBe(...)
	/usr/local/go/src/reflect/value.go:221
reflect.Value.MapKeys({0x0?, 0x0?, 0x2b74b10?})
	/usr/local/go/src/reflect/map_swiss.go:211 +0x208
github.com/playwright-community/playwright-go.remapValue({0x0?, 0x0?, 0x40068adcb8?}, {0x2188860?, 0x4005c83728?, 0x2188860?})
	/go/pkg/mod/github.com/playwright-community/playwright-go@v0.5001.0/helpers.go:161 +0x5c8
github.com/playwright-community/playwright-go.remapMapToStruct({0x0?, 0x0?}, {0x1cedb20?, 0x4005c83728?})
	/go/pkg/mod/github.com/playwright-community/playwright-go@v0.5001.0/helpers.go:174 +0x100
github.com/playwright-community/playwright-go.(*responseImpl).ServerAddr(0x4005992bb0?)
	/go/pkg/mod/github.com/playwright-community/playwright-go@v0.5001.0/response.go:140 +0x84

Additional context
The issue seems to be caused by remapMapToStruct being called with nil input, leading to a reflection call on a nil map at helpers.go:161.

Metadata

Metadata

Assignees

No one assigned

    Labels

    p2-bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions