Fix neglected io.EOF handling

This was probably catched in most cases after commit 9dd92e1, but was
at best misleading as it suggested that the end of input stream signal
from xml.Decoder was intentionally ignored.

Ref mattn/go-xmpp#28
This commit is contained in:
Martin Hebnes Pedersen
2017-11-03 13:12:33 +01:00
parent e69bd697cb
commit 127e75bc8b
2 changed files with 12 additions and 1 deletions

View File

@@ -833,7 +833,7 @@ type rosterItem struct {
func nextStart(p *xml.Decoder) (xml.StartElement, error) {
for {
t, err := p.Token()
if err != nil && err != io.EOF || t == nil {
if err != nil || t == nil {
return xml.StartElement{}, err
}
switch t := t.(type) {