[Pleroma.Web.MastodonAPI.MastodonAPIController]: fallback for try_render/4
[akkoma] / lib / pleroma / formatter.ex
index d7de5b483067a74df23d15ffe1a6fc6a4f2f3876..1756cc187124aafd8c33af2e4d5051a74e9c6b01 100644 (file)
@@ -227,7 +227,12 @@ defmodule Pleroma.Formatter do
     subs =
       subs ++
         Enum.map(mentions, fn {match, %User{ap_id: ap_id, info: info}, uuid} ->
-          ap_id = info["source_data"]["url"] || ap_id
+          ap_id =
+            if is_binary(info["source_data"]["url"]) do
+              info["source_data"]["url"]
+            else
+              ap_id
+            end
 
           short_match = String.split(match, "@") |> tl() |> hd()