ensure we can't have a null in appends

This commit is contained in:
FloatingGhost 2023-03-11 17:24:49 +00:00
parent 9977588612
commit 5ca22c2459
1 changed files with 3 additions and 1 deletions

View File

@ -227,8 +227,10 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
|> Enum.filter(fn tag -> is_map(tag) and tag["type"] == "Mention" end)
|> Enum.map(fn tag -> tag["href"] end)
to_data = if is_nil(object.data["to"]), do: [], else: object.data["to"]
mentions =
(object.data["to"] ++ tag_mentions)
(to_data ++ tag_mentions)
|> Enum.uniq()
|> Enum.map(fn
Pleroma.Constants.as_public() -> nil