Rendering fallback for when we don't have valid data available
authorMark Felder <feld@feld.me>
Wed, 10 Feb 2021 00:51:59 +0000 (18:51 -0600)
committerMark Felder <feld@feld.me>
Wed, 10 Feb 2021 00:52:22 +0000 (18:52 -0600)
lib/pleroma/web/mastodon_api/views/status_view.ex

index e4f623b973550ab78db3998bedcdbc628f2b2007..38960c25616a481ebb7babfc7d52091c0c47b5da 100644 (file)
@@ -180,7 +180,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
       media_attachments: reblogged[:media_attachments] || [],
       mentions: mentions,
       tags: reblogged[:tags] || [],
-      application: activity_object.data["application"],
+      application: activity_object.data["application"] || %{name: "Web", website: nil},
       language: nil,
       emojis: [],
       pleroma: %{
@@ -345,7 +345,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
       poll: render(PollView, "show.json", object: object, for: opts[:for]),
       mentions: mentions,
       tags: build_tags(tags),
-      application: object.data["application"],
+      application: object.data["application"] || %{name: "Web", website: nil},
       language: nil,
       emojis: build_emojis(object.data["emoji"]),
       pleroma: %{