aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorfeld <feld@feld.me>2019-05-30 21:03:31 +0000
committerfeld <feld@feld.me>2019-05-30 21:03:31 +0000
commit73a7420c23308d19aa270ba6345a9b2b963abee6 (patch)
treee786a84700608abe39307ffe241a0e3e0164e105 /lib
parent91ac8b075b0a8c82b5e8a9d3316724e534486932 (diff)
parent1690be991ede33998203226998b8023a247a4f84 (diff)
downloadpleroma-73a7420c23308d19aa270ba6345a9b2b963abee6.tar.gz
Merge branch 'fix/ogp-missing-data' into 'develop'
Replace missing non-nullable Card attributes with empty strings See merge request pleroma/pleroma!1217
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/mastodon_api/views/status_view.ex4
-rw-r--r--lib/pleroma/web/rich_media/parser.ex5
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex
index e55f9b96e..84ab20a1c 100644
--- a/lib/pleroma/web/mastodon_api/views/status_view.ex
+++ b/lib/pleroma/web/mastodon_api/views/status_view.ex
@@ -290,8 +290,8 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
provider_url: page_url_data.scheme <> "://" <> page_url_data.host,
url: page_url,
image: image_url |> MediaProxy.url(),
- title: rich_media[:title],
- description: rich_media[:description],
+ title: rich_media[:title] || "",
+ description: rich_media[:description] || "",
pleroma: %{
opengraph: rich_media
}
diff --git a/lib/pleroma/web/rich_media/parser.ex b/lib/pleroma/web/rich_media/parser.ex
index 62e8fa610..e4595800c 100644
--- a/lib/pleroma/web/rich_media/parser.ex
+++ b/lib/pleroma/web/rich_media/parser.ex
@@ -37,7 +37,10 @@ defmodule Pleroma.Web.RichMedia.Parser do
try do
{:ok, %Tesla.Env{body: html}} = Pleroma.HTTP.get(url, [], adapter: @hackney_options)
- html |> maybe_parse() |> clean_parsed_data() |> check_parsed_data()
+ html
+ |> maybe_parse()
+ |> clean_parsed_data()
+ |> check_parsed_data()
rescue
e ->
{:error, "Parsing error: #{inspect(e)}"}