Check if item.Content != nil, because it doesn't have to be set

This commit is contained in:
Peter Stuifzand 2018-07-05 22:56:31 +02:00
parent c613e18c7a
commit 66321c44a5

View File

@ -332,8 +332,10 @@ func (b *memoryBackend) feedItems(fetchURL, contentType string, body io.Reader)
for _, item := range items {
log.Printf("ID=%s Name=%s\n", item.ID, item.Name)
log.Printf("Author=%#v\n", item.Author)
log.Printf("Text=%s\n", item.Content.Text)
log.Printf("HTML=%s\n", item.Content.HTML)
if item.Content != nil {
log.Printf("Text=%s\n", item.Content.Text)
log.Printf("HTML=%s\n", item.Content.HTML)
}
}
return items, nil