commit | f43dfb5ff114b82b6bff2fe6b18f64ca4145681b | [log] [tgz] |
---|---|---|
author | Googler <noreply@google.com> | Sun Jun 05 12:03:06 2016 -0700 |
committer | Ross Light <light@google.com> | Wed Jun 08 12:03:06 2016 -0700 |
tree | b8cabc7723768b6552d387bbefcf4bb49a8c3bec | |
parent | 3b06fc7a4cad73efce5fe6217ab6c33e7231ab4a [diff] |
Add missing error check in jsonpb's marshal implementation. Otherwise invalid JSON can be produced.
diff --git a/jsonpb/jsonpb.go b/jsonpb/jsonpb.go index 0ad60eb..40d96c4 100644 --- a/jsonpb/jsonpb.go +++ b/jsonpb/jsonpb.go
@@ -382,7 +382,9 @@ out.write(m.Indent) out.write(m.Indent) } - m.marshalValue(out, prop, sliceVal, indent+m.Indent) + if err := m.marshalValue(out, prop, sliceVal, indent+m.Indent); err != nil { + return err + } comma = "," } if m.Indent != "" {