From f04d2b9225b80333f03a3cc9366df4a05af88a73 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 20 Jun 2023 15:50:27 +0200 Subject: [PATCH] fix(backend): filter out nil tags before starting looking for existing ones Signed-off-by: Thomas Citharel --- lib/federation/activity_stream/converter/utils.ex | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/federation/activity_stream/converter/utils.ex b/lib/federation/activity_stream/converter/utils.ex index 95ce6728a..9101fc117 100644 --- a/lib/federation/activity_stream/converter/utils.ex +++ b/lib/federation/activity_stream/converter/utils.ex @@ -26,7 +26,11 @@ defmodule Mobilizon.Federation.ActivityStream.Converter.Utils do Logger.debug("fetching tags") Logger.debug(inspect(tags)) - tags |> Enum.flat_map(&fetch_tag/1) |> Enum.uniq() |> Enum.map(&existing_tag_or_data/1) + tags + |> Enum.flat_map(&fetch_tag/1) + |> Enum.uniq() + |> Enum.filter(& &1) + |> Enum.map(&existing_tag_or_data/1) end def fetch_tags(_), do: []