From 3b0e9287a5c36dea7b7a4a240a14295cb17420b4 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Wed, 29 Aug 2018 21:07:12 +0200 Subject: [PATCH] [Pleroma.Web.MastodonAPI.StatusView]: Return nil as fallback for missing views --- lib/pleroma/web/mastodon_api/views/status_view.ex | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex index ef46ba4fc..d50e82274 100644 --- a/lib/pleroma/web/mastodon_api/views/status_view.ex +++ b/lib/pleroma/web/mastodon_api/views/status_view.ex @@ -158,6 +158,10 @@ def render("status.json", %{activity: %{data: %{"object" => object}} = activity} } end + def render("status.json", %{activity: %{data: %{"object" => object}} = activity} = opts) do + nil + end + def render("attachment.json", %{attachment: attachment}) do [attachment_url | _] = attachment["url"] media_type = attachment_url["mediaType"] || attachment_url["mimeType"] || "image"