From d7974c3e26c53a32a22aedb960a9e91e6680aa2d Mon Sep 17 00:00:00 2001 From: Milan Aleksic Date: Wed, 31 May 2017 18:12:31 +0200 Subject: [PATCH] Making Source field optional --- rss.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rss.go b/rss.go index b790612..ec65e8f 100644 --- a/rss.go +++ b/rss.go @@ -90,11 +90,13 @@ func newRssItem(i *Item) *RssItem { item := &RssItem{ Title: i.Title, Link: i.Link.Href, - Source: i.Source.Href, Description: i.Description, Guid: i.Id, PubDate: anyTimeFormat(time.RFC1123Z, i.Created, i.Updated), } + if i.Source != nil { + item.Source = i.Source.Href + } intLength, err := strconv.ParseInt(i.Link.Length, 10, 64)