Sync from internal version.
          - fix nil Marshaler fields
          - fix text encoding of nil

R=r
CC=golang-dev
http://codereview.appspot.com/2023043
diff --git a/proto/text.go b/proto/text.go
index 4d5446a..ee80c85 100644
--- a/proto/text.go
+++ b/proto/text.go
@@ -189,6 +189,10 @@
 }
 
 func marshalText(w io.Writer, pb interface{}, compact bool) {
+	if pb == nil {
+		w.Write([]byte("<nil>"))
+		return
+	}
 	aw := new(textWriter)
 	aw.writer = w
 	aw.complete = true