From 9afc672009ac49075530f44aefd73a17a0c50d43 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Fri, 21 Apr 2017 01:01:58 +0200 Subject: [PATCH] Quick fix for activities without 'to'. --- lib/pleroma/web/twitter_api/twitter_api.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pleroma/web/twitter_api/twitter_api.ex b/lib/pleroma/web/twitter_api/twitter_api.ex index ce29d46a1..1053120c4 100644 --- a/lib/pleroma/web/twitter_api/twitter_api.ex +++ b/lib/pleroma/web/twitter_api/twitter_api.ex @@ -318,7 +318,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do actor = get_in(activity.data, ["actor"]) user = User.get_cached_by_ap_id(actor) # mentioned_users = Repo.all(from user in User, where: user.ap_id in ^activity.data["to"]) - mentioned_users = Enum.map(activity.data["to"], fn (ap_id) -> + mentioned_users = Enum.map(activity.data["to"] || [], fn (ap_id) -> User.get_cached_by_ap_id(ap_id) end) |> Enum.filter(&(&1))