fetcher: fallback to [] when to/cc is nil
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Tue, 18 Aug 2020 00:01:40 +0000 (02:01 +0200)
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Tue, 18 Aug 2020 00:02:20 +0000 (02:02 +0200)
Related: https://git.pleroma.social/pleroma/pleroma/-/issues/2063

lib/pleroma/object/fetcher.ex

index 3ff25118d5160c82b3f4922b29593f8f8eca5f28..6fdbc8efd175006f73d3bda0a2a8e180a5f06d21 100644 (file)
@@ -125,8 +125,8 @@ defmodule Pleroma.Object.Fetcher do
   defp prepare_activity_params(data) do
     %{
       "type" => "Create",
-      "to" => data["to"],
-      "cc" => data["cc"],
+      "to" => data["to"] || [],
+      "cc" => data["cc"] || [],
       # Should we seriously keep this attributedTo thing?
       "actor" => data["actor"] || data["attributedTo"],
       "object" => data