From f5aa7ffa743ec652726aa577d0027b3b531a2af4 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 30 Jun 2021 10:13:57 +0200 Subject: [PATCH] Fix crash when trying to notify activities not from groups Signed-off-by: Thomas Citharel --- lib/service/workers/activity_builder.ex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/service/workers/activity_builder.ex b/lib/service/workers/activity_builder.ex index 85e4f2deb..2d9a49c32 100644 --- a/lib/service/workers/activity_builder.ex +++ b/lib/service/workers/activity_builder.ex @@ -33,7 +33,7 @@ defmodule Mobilizon.Service.Workers.ActivityBuilder do end @spec users_to_notify(Activity.t()) :: list(User.t()) - defp users_to_notify(%Activity{group: %Actor{} = group, author_id: author_id}) do + defp users_to_notify(%Activity{group: %Actor{type: :Group} = group, author_id: author_id}) do group |> Actors.list_internal_actors_members_for_group([ :creator, @@ -47,4 +47,6 @@ defmodule Mobilizon.Service.Workers.ActivityBuilder do |> Enum.uniq() |> Enum.map(&Users.get_user_with_settings!/1) end + + defp users_to_notify(_), do: [] end