From 66321c44a588e08914d0162c6c3b24f3a269780c Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Thu, 5 Jul 2018 22:56:31 +0200 Subject: [PATCH] Check if item.Content != nil, because it doesn't have to be set --- cmd/eksterd/fetch.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/eksterd/fetch.go b/cmd/eksterd/fetch.go index 070e29e..0c3b443 100644 --- a/cmd/eksterd/fetch.go +++ b/cmd/eksterd/fetch.go @@ -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