diff options
author | Adam Mathes <adam@trenchant.org> | 2017-02-02 20:15:10 -0800 |
---|---|---|
committer | Adam Mathes <adam@trenchant.org> | 2017-02-02 20:15:10 -0800 |
commit | 9c45088948c9068a25be9a8a459c4453ef7e7bcd (patch) | |
tree | 490b9abb0a403328dddf300e51ab2f0bcbe59f0d /crawler | |
parent | 869185513695184a635ce6e450d4ad83a1a364da (diff) | |
download | neko-9c45088948c9068a25be9a8a459c4453ef7e7bcd.tar.gz neko-9c45088948c9068a25be9a8a459c4453ef7e7bcd.tar.bz2 neko-9c45088948c9068a25be9a8a459c4453ef7e7bcd.zip |
fix crash on import related to unparsed dates
Diffstat (limited to 'crawler')
-rw-r--r-- | crawler/crawler.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crawler/crawler.go b/crawler/crawler.go index 3d98e02..ab776dc 100644 --- a/crawler/crawler.go +++ b/crawler/crawler.go @@ -72,8 +72,9 @@ func CrawlFeed(f *feed.Feed, ch chan<- string) { item.Description = encoded } - item.PublishDate = i.PublishedParsed.Format(time.RFC3339) - + if(i.PublishedParse != nil) { + item.PublishDate = i.PublishedParsed.Format(time.RFC3339) + } item.FeedId = f.Id err := item.Create() if err != nil { |