OGP/TwitterCard: Add fallbacks in case the attachment key is nonexistent

This commit is contained in:
rinpatch 2019-07-08 12:16:32 +03:00 committed by Ariadne Conill
parent 876b5b45a3
commit fd4963006a
2 changed files with 3 additions and 0 deletions

View File

@ -121,4 +121,6 @@ defp build_attachments(%{data: %{"attachment" => attachments}}) do
acc ++ rendered_tags
end)
end
defp build_attachments(_), do: []
end

View File

@ -116,6 +116,7 @@ defp build_attachments(id, %{data: %{"attachment" => attachments}}) do
acc ++ rendered_tags
end)
end
defp build_attachments(_id, _object), do: []
defp player_url(id) do
Pleroma.Web.Router.Helpers.o_status_url(Pleroma.Web.Endpoint, :notice_player, id)