From 5ca22c2459fb7d9c0d734aaa892c8058d6ab56c0 Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Sat, 11 Mar 2023 17:24:49 +0000 Subject: [PATCH] ensure we can't have a null in appends --- lib/pleroma/web/mastodon_api/views/status_view.ex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex index 79438571c..3868da8d9 100644 --- a/lib/pleroma/web/mastodon_api/views/status_view.ex +++ b/lib/pleroma/web/mastodon_api/views/status_view.ex @@ -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