Skip to content
Snippets Groups Projects
Commit 7f530f6f authored by kaniini's avatar kaniini
Browse files

mastodon api: relationship view: better handle no pre-existing follow activity

parent e69faf55
Branches
No related tags found
No related merge requests found
......@@ -73,7 +73,13 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do
def render("relationship.json", %{user: user, target: target}) do
follow_activity = Pleroma.Web.ActivityPub.Utils.fetch_latest_follow(user, target)
requested = follow_activity.data["state"] == "pending"
requested =
if follow_activity do
follow_activity.data["state"] == "pending"
else
false
end
%{
id: to_string(target.id),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment