[Pleroma.Web.MastodonAPI.StatusView]: Return nil as fallback for missing views

This commit is contained in:
Haelwenn (lanodan) Monnier 2018-08-29 21:07:12 +02:00
parent a8137159c2
commit 3b0e9287a5
No known key found for this signature in database
GPG Key ID: D5B7A8E43C997DEE
1 changed files with 4 additions and 0 deletions

View File

@ -158,6 +158,10 @@ def render("status.json", %{activity: %{data: %{"object" => object}} = activity}
} }
end end
def render("status.json", %{activity: %{data: %{"object" => object}} = activity} = opts) do
nil
end
def render("attachment.json", %{attachment: attachment}) do def render("attachment.json", %{attachment: attachment}) do
[attachment_url | _] = attachment["url"] [attachment_url | _] = attachment["url"]
media_type = attachment_url["mediaType"] || attachment_url["mimeType"] || "image" media_type = attachment_url["mediaType"] || attachment_url["mimeType"] || "image"