Commit ecdb0b7f authored by kaniini's avatar kaniini

Merge branch 'bugfix/rich-media-image-nil' into 'develop'

mastodon api: fix rendering of cards without image URLs (closes #597)

Closes #597

See merge request pleroma/pleroma!777
parents f8b831ec c4d317cc
Pipeline #7103 failed with stages
in 3 minutes and 23 seconds
......@@ -192,8 +192,12 @@ def render("card.json", %{rich_media: rich_media, page_url: page_url}) do
page_url = page_url_data |> to_string
image_url =
URI.merge(page_url_data, URI.parse(rich_media[:image]))
|> to_string
if rich_media[:image] != nil do
URI.merge(page_url_data, URI.parse(rich_media[:image]))
|> to_string
else
nil
end
site_name = rich_media[:site_name] || page_url_data.host
......
......@@ -36,6 +36,7 @@ test "it returns HTTP 200", %{conn: conn} do
describe "GET /api/statusnet/config.json" do
test "it returns the managed config", %{conn: conn} do
Pleroma.Config.put([:instance, :managed_config], false)
Pleroma.Config.put([:fe, :theme], "rei-ayanami-towel")
response =
conn
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment