From f6a17d8b3a0db0097b196b39d4a4d2ec3b6268ba Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 3 May 2022 11:41:17 +0200 Subject: [PATCH] Improve a guard Signed-off-by: Thomas Citharel --- lib/federation/activity_pub/audience.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/federation/activity_pub/audience.ex b/lib/federation/activity_pub/audience.ex index 19502dfaa..fd1a97f6e 100644 --- a/lib/federation/activity_pub/audience.ex +++ b/lib/federation/activity_pub/audience.ex @@ -228,13 +228,13 @@ defmodule Mobilizon.Federation.ActivityPub.Audience do |> Enum.uniq() end - defp add_event_contacts(%Event{contacts: contacts}) do + defp add_event_contacts(%Event{contacts: contacts}) when is_list(contacts) do contacts |> Enum.map(& &1.url) |> Enum.uniq() end - defp add_event_contacts(%Event{}), do: [] + defp add_event_contacts(_), do: [] defp process_mention({_, mentioned_actor}), do: mentioned_actor.url