structs.go
changeset 2 4dabfef08c8c
parent 1 a01e06faf0db
child 3 6121aa2f21b1
--- a/structs.go	Sat Dec 24 00:39:18 2011 -0700
+++ b/structs.go	Sat Dec 24 09:55:26 2011 -0700
@@ -44,7 +44,7 @@
 
 type StreamError struct {
 	cond definedCondition
-	text errText
+	text *errText
 }
 var _ xml.Marshaler = &StreamError{}
 
@@ -54,7 +54,6 @@
 }
 
 type errText struct {
-	XMLName xml.Name
 	Lang string
 	text string `xml:"chardata"`
 }
@@ -88,7 +87,9 @@
 	buf := bytes.NewBuffer(nil)
 	buf.WriteString("<stream:error>")
 	xml.Marshal(buf, s.cond)
-	xml.Marshal(buf, s.text)
+	if s.text != nil {
+		xml.Marshal(buf, s.text)
+	}
 	buf.WriteString("</stream:error>")
 	return buf.Bytes(), nil
 }