| commit | d4661c52874fa631273d57ea7844d0ff283d3127 | [log] [tgz] |
|---|---|---|
| author | David Symonds <dsymonds@golang.org> | Thu Aug 30 15:17:53 2012 +1000 |
| committer | David Symonds <dsymonds@golang.org> | Thu Aug 30 15:17:53 2012 +1000 |
| tree | 5e89b31f703f8da603d2aca69c3766393d0379aa | |
| parent | 6a6f82cf8c587dcc354d0a961416c91bec58c97d [diff] [blame] |
goprotobuf: Fix Marshal crash on typed nil. Also a bunch of other trivial updates. R=r CC=golang-dev http://codereview.appspot.com/6501064
diff --git a/proto/encode.go b/proto/encode.go index 2eec125..4e55816 100644 --- a/proto/encode.go +++ b/proto/encode.go
@@ -196,6 +196,9 @@ } t, b, err := getbase(pb) + if b == 0 { + return ErrNil + } if err == nil { err = p.enc_struct(t.Elem(), GetProperties(t.Elem()), b) }