Skip to content

CLI panics if result type has multiple views #2681

Open
@sm43

Description

I have an example here.

If you run the service and invoke the API using CLI.

./user-cli user get

this returns

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

goroutine 1 [running]:
github.com/sm43/user-goa/gen/http/user/client.unmarshalCompanyResponseBodyToUserviewsCompanyView(...)
	/home/smukhade/go/src/github.com/sm43/user-goa/gen/http/user/client/encode_decode.go:83
github.com/sm43/user-goa/gen/http/user/client.NewGetUserOK(0xc000012090, 0x7991c0)
	/home/smukhade/go/src/github.com/sm43/user-goa/gen/http/user/client/types.go:45 +0x8b
github.com/sm43/user-goa/gen/http/user/client.DecodeGetResponse.func1(0xc000076000, 0x0, 0x0, 0x0, 0x0)
	/home/smukhade/go/src/github.com/sm43/user-goa/gen/http/user/client/encode_decode.go:64 +0x2e9
github.com/sm43/user-goa/gen/http/user/client.(*Client).Get.func1(0x8c3ec0, 0xc0000a0000, 0x0, 0x0, 0x1e, 0x0, 0xc0000aac00, 0x0)
	/home/smukhade/go/src/github.com/sm43/user-goa/gen/http/user/client/client.go:67 +0x120
main.main()
	/home/smukhade/go/src/github.com/sm43/user-goa/cmd/user-cli/main.go:82 +0x53f

So, there are 3 cases I have created, the 3rd one seems to be breaking.
HTTP response are correct but in CLI it breaks.

cc @raphael

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions