aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Mathes <adam@trenchant.org>2017-02-02 20:15:10 -0800
committerAdam Mathes <adam@trenchant.org>2017-02-02 20:15:10 -0800
commit9c45088948c9068a25be9a8a459c4453ef7e7bcd (patch)
tree490b9abb0a403328dddf300e51ab2f0bcbe59f0d
parent869185513695184a635ce6e450d4ad83a1a364da (diff)
downloadneko-9c45088948c9068a25be9a8a459c4453ef7e7bcd.tar.gz
neko-9c45088948c9068a25be9a8a459c4453ef7e7bcd.tar.bz2
neko-9c45088948c9068a25be9a8a459c4453ef7e7bcd.zip
fix crash on import related to unparsed dates
-rw-r--r--crawler/crawler.go5
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 {