|
@@ -1106,6 +1106,11 @@ func (o *Buffer) enc_new_map(p *Properties, base structPointer) error {
|
|
|
for _, key := range keys {
|
|
for _, key := range keys {
|
|
|
val := v.MapIndex(key)
|
|
val := v.MapIndex(key)
|
|
|
|
|
|
|
|
|
|
+ // The only illegal map entry values are nil message pointers.
|
|
|
|
|
+ if val.Kind() == reflect.Ptr && val.IsNil() {
|
|
|
|
|
+ return errors.New("proto: map has nil element")
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
keycopy.Set(key)
|
|
keycopy.Set(key)
|
|
|
valcopy.Set(val)
|
|
valcopy.Set(val)
|
|
|
|
|
|