From 281806de75ae5b0cad0c9b0f5dbc7c01c0b64f93 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 24 Jun 2021 21:00:23 -0500 Subject: [PATCH] Activity deletion: fix FunctionClauseError #2686 --- lib/pleroma/activity.ex | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/pleroma/activity.ex b/lib/pleroma/activity.ex index 53beca5e6..7e36c1b53 100644 --- a/lib/pleroma/activity.ex +++ b/lib/pleroma/activity.ex @@ -313,13 +313,15 @@ defmodule Pleroma.Activity do def delete_all_by_object_ap_id(_), do: nil - defp purge_web_resp_cache(%Activity{} = activity) do - %{path: path} = URI.parse(activity.data["id"]) - @cachex.del(:web_resp_cache, path) + defp purge_web_resp_cache(%Activity{data: %{"id" => id}} = activity) when is_binary(id) do + with %{path: path} <- URI.parse(id) do + @cachex.del(:web_resp_cache, path) + end + activity end - defp purge_web_resp_cache(nil), do: nil + defp purge_web_resp_cache(activity), do: activity def follow_accepted?( %Activity{data: %{"type" => "Follow", "object" => followed_ap_id}} = activity