aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaniini <nenolod@gmail.com>2019-02-05 18:53:43 +0000
committerkaniini <nenolod@gmail.com>2019-02-05 18:53:43 +0000
commitecdb0b7f57e662c8a2a4391f218713d4cd1347f1 (patch)
tree3022f4aa17405d2ef932460b52d2a1934a368e1a
parentf8b831ecfd7c64c6382fccde7bdc5b0f7183f258 (diff)
parentc4d317ccb679f7fef11983b9629249e047bec4db (diff)
downloadpleroma-ecdb0b7f57e662c8a2a4391f218713d4cd1347f1.tar.gz
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
-rw-r--r--lib/pleroma/web/mastodon_api/views/status_view.ex8
-rw-r--r--test/web/twitter_api/util_controller_test.exs1
2 files changed, 7 insertions, 2 deletions
diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex
index d1b11d4f1..c0e289ef8 100644
--- a/lib/pleroma/web/mastodon_api/views/status_view.ex
+++ b/lib/pleroma/web/mastodon_api/views/status_view.ex
@@ -192,8 +192,12 @@ defmodule Pleroma.Web.MastodonAPI.StatusView 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
diff --git a/test/web/twitter_api/util_controller_test.exs b/test/web/twitter_api/util_controller_test.exs
index dc9bad369..8e152ecd4 100644
--- a/test/web/twitter_api/util_controller_test.exs
+++ b/test/web/twitter_api/util_controller_test.exs
@@ -36,6 +36,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest 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