fix(backend): filter out nil tags before starting looking for existing ones

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2023-06-20 15:50:27 +02:00
parent d5021647d7
commit f04d2b9225
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773
1 changed files with 5 additions and 1 deletions

View File

@ -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: []