From eb1a18d22f0284cfee571e6a83d4ddf69042dba0 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Wed, 2 Jan 2019 22:47:12 +0000 Subject: [PATCH] user: check that the follow request actually has an active account associated with it because of user refetch, accounts can stop existing (get_from_ap_id() can fail), accordingly filter the follow requests for these failures. --- lib/pleroma/user.ex | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 892f4e483..1edded415 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -495,6 +495,7 @@ def get_follow_requests(%User{} = user) do Enum.map(reqs, fn req -> req.actor end) |> Enum.uniq() |> Enum.map(fn ap_id -> get_by_ap_id(ap_id) end) + |> Enum.filter(fn u -> !is_nil(u) end) |> Enum.filter(fn u -> !following?(u, user) end) {:ok, users}