Skip to content

Commit

Permalink
fix(podcast): nil pointer when podcast has no image
Browse files Browse the repository at this point in the history
  • Loading branch information
superfrink committed Nov 15, 2024
1 parent 643ffff commit 939408a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion podcast/podcast.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,14 @@ func (p *Podcasts) AddNewPodcast(rssURL string, feed *gofeed.Feed) (*db.Podcast,
}
podcast := db.Podcast{
Description: feed.Description,
ImageURL: feed.Image.URL,
ImageURL: "",
Title: feed.Title,
URL: rssURL,
RootDir: rootDir,
}
if feed.Image != nil {
podcast.ImageURL = feed.Image.URL
}
if err := os.Mkdir(podcast.RootDir, 0o755); err != nil && !os.IsExist(err) {
return nil, err
}
Expand Down

0 comments on commit 939408a

Please sign in to comment.