diff options
Diffstat (limited to 'vendor/github.com/gorilla/feeds/rss.go')
-rw-r--r-- | vendor/github.com/gorilla/feeds/rss.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/vendor/github.com/gorilla/feeds/rss.go b/vendor/github.com/gorilla/feeds/rss.go index 09179dfb2..8c227a8b7 100644 --- a/vendor/github.com/gorilla/feeds/rss.go +++ b/vendor/github.com/gorilla/feeds/rss.go @@ -95,11 +95,13 @@ type Rss struct { func newRssItem(i *Item) *RssItem { item := &RssItem{ Title: i.Title, - Link: i.Link.Href, Description: i.Description, Guid: i.Id, PubDate: anyTimeFormat(time.RFC1123Z, i.Created, i.Updated), } + if i.Link != nil { + item.Link = i.Link.Href + } if len(i.Content) > 0 { item.Content = &RssContent{Content: i.Content} } @@ -135,9 +137,13 @@ func (r *Rss) RssFeed() *RssFeed { image = &RssImage{Url: r.Image.Url, Title: r.Image.Title, Link: r.Image.Link, Width: r.Image.Width, Height: r.Image.Height} } + var href string + if r.Link != nil { + href = r.Link.Href + } channel := &RssFeed{ Title: r.Title, - Link: r.Link.Href, + Link: href, Description: r.Description, ManagingEditor: author, PubDate: pub, |