user: check that the follow request actually has an active account associated with it
authorWilliam Pitcock <nenolod@dereferenced.org>
Wed, 2 Jan 2019 22:47:12 +0000 (22:47 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Wed, 2 Jan 2019 22:47:12 +0000 (22:47 +0000)
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

index 892f4e483be6e63ced3403abec02befc931a3a65..1edded4151fe0e4a16a9635acec473c04c77c6a8 100644 (file)
@@ -495,6 +495,7 @@ defmodule Pleroma.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}