We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The following program crashes with a panic:
package main import ( "github.com/golang/protobuf/proto" "io/ioutil" pb "protorepro/pb" ) func main() { proto.MarshalText(ioutil.Discard, &pb.M2{F: map[string]*pb.M1{"": nil}}) }
panic: reflect: call of reflect.Value.Interface on zero Value goroutine 1 [running]: runtime.gopanic(0x52e860, 0xc20800e4a0) src/runtime/panic.go:461 +0x401 fp=0xc2080415a0 sp=0xc208041520 reflect.valueInterface(0x0, 0x0, 0x0, 0x542801, 0x0, 0x0) src/reflect/value.go:906 +0x82 fp=0xc2080415f8 sp=0xc2080415a0 reflect.Value.Interface(0x0, 0x0, 0x0, 0x0, 0x0) src/reflect/value.go:901 +0x4f fp=0xc208041630 sp=0xc2080415f8 github.com/golang/protobuf/proto.writeAny(0xc20800e400, 0x0, 0x0, 0x0, 0xc208070240, 0x0, 0x0) src/github.com/golang/protobuf/proto/text.go:465 +0x632 fp=0xc2080417f8 sp=0xc208041630 github.com/golang/protobuf/proto.writeStruct(0xc20800e400, 0x536380, 0xc20800e3e0, 0xd9, 0x0, 0x0) src/github.com/golang/protobuf/proto/text.go:295 +0xf89 fp=0xc208041da0 sp=0xc2080417f8 github.com/golang/protobuf/proto.marshalText(0x7f558bbca1e8, 0xc20800a5f0, 0x7f558bbca210, 0xc20800e3e0, 0x62c100, 0x0, 0x0) src/github.com/golang/protobuf/proto/text.go:759 +0x440 fp=0xc208041ee0 sp=0xc208041da0 github.com/golang/protobuf/proto.MarshalText(0x7f558bbca1e8, 0xc20800a5f0, 0x7f558bbca210, 0xc20800e3e0, 0x0, 0x0) src/github.com/golang/protobuf/proto/text.go:771 +0x57 fp=0xc208041f20 sp=0xc208041ee0 main.main() protorepro.go:10 +0x129 fp=0xc208041f90 sp=0xc208041f20
The proto used is:
syntax = "proto2"; package example; message M1 { optional uint32 f = 1; } message M2 { map<string, M1> f = 1; }
golang/protobuf is on 16256d3 protobuf is on fe7b566
The text was updated successfully, but these errors were encountered:
34a5f24
Behave gracefully when text formatting a map field with a nil value.
48cb2e1
Fixes golang#33.
dsymonds
No branches or pull requests
The following program crashes with a panic:
The proto used is:
golang/protobuf is on 16256d3
protobuf is on fe7b566
The text was updated successfully, but these errors were encountered: