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 != "" {