diff --git a/main.go b/main.go index 3160501..ac8f977 100644 --- a/main.go +++ b/main.go @@ -47,11 +47,13 @@ func main() { itemDetailsPath, GrabFeedItemJSON(item)) - itemImagePath := itemOutputDir + "/image" + RemoveGetParams(filepath.Ext(item.Image.URL)) - LogInfo("Downloading image to " + itemImagePath) - DownloadFile( - itemImagePath, - item.Image.URL) + if item.Image != nil { + itemImagePath := itemOutputDir + "/image" + RemoveGetParams(filepath.Ext(item.Image.URL)) + LogInfo("Downloading image to " + itemImagePath) + DownloadFile( + itemImagePath, + item.Image.URL) + } for _, enclosure := range item.Enclosures { filename := RemoveGetParams(filepath.Base(enclosure.URL))