lint: check error for decoder

This commit is contained in:
Umputun
2017-12-24 12:22:56 -06:00
parent c5d8b90a1d
commit 881b8948d4
+6 -3
View File
@@ -105,12 +105,15 @@ func (d *Disqus) convert(r io.Reader, siteID string) (ch chan store.Comment) {
case xml.StartElement:
if se.Name.Local == "thread" {
thread := disqusThread{}
decoder.DecodeElement(&thread, &se)
postsMap[thread.UID] = thread.Link
if err := decoder.DecodeElement(&thread, &se); err == nil {
postsMap[thread.UID] = thread.Link
}
}
if se.Name.Local == "post" {
comment := disqusComment{}
decoder.DecodeElement(&comment, &se)
if err := decoder.DecodeElement(&comment, &se); err != nil {
continue
}
c := store.Comment{
ID: comment.ID,
Locator: store.Locator{URL: postsMap[comment.Tid.Val], SiteID: siteID},