Fix error on atom feed with no authors

This commit is contained in:
Shadowfacts 2021-09-05 23:16:04 -04:00
parent 13394e38f6
commit c2323ae19a
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 8 additions and 2 deletions

View File

@ -72,7 +72,13 @@ defmodule FeedParser.Parser.Atom do
_ -> nil _ -> nil
end end
author = texts('/entry/author/name/text()', entry) || feed_author author =
texts('/entry/author/name/text()', entry) ||
feed_author
|> case do
nil -> nil
authors -> Enum.join(authors, ", ")
end
content = text('/entry/content/text()', entry) || text('/entry/summary/text()', entry) content = text('/entry/content/text()', entry) || text('/entry/summary/text()', entry)
@ -83,7 +89,7 @@ defmodule FeedParser.Parser.Atom do
links: links, links: links,
content: content, content: content,
date: updated, date: updated,
creator: author |> Enum.join(", ") creator: author
} }
end) end)