From: William Pitcock Date: Tue, 19 Mar 2019 17:30:25 +0000 (+0000) Subject: activitypub: transmogrifier: do not allow missing lists to be interpreted as nil X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=d487b753c3116e7a4261404b2357f337acc2d64d;p=akkoma activitypub: transmogrifier: do not allow missing lists to be interpreted as nil --- diff --git a/lib/pleroma/web/activity_pub/transmogrifier.ex b/lib/pleroma/web/activity_pub/transmogrifier.ex index 7f3d8fd4b..9d536f7f5 100644 --- a/lib/pleroma/web/activity_pub/transmogrifier.ex +++ b/lib/pleroma/web/activity_pub/transmogrifier.ex @@ -86,11 +86,15 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do end def fix_addressing_list(map, field) do - if is_binary(map[field]) do - map - |> Map.put(field, [map[field]]) - else - map + cond do + is_binary(map[field]) -> + Map.put(map, field, [map[field]]) + + is_nil(map[field]) -> + Map.put(map, field, []) + + true -> + map end end