activitypub: transmogrifier: do not allow missing lists to be interpreted as nil
This commit is contained in:
parent
798da28812
commit
d487b753c3
@ -86,10 +86,14 @@ 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
|
||||
cond do
|
||||
is_binary(map[field]) ->
|
||||
Map.put(map, field, [map[field]])
|
||||
|
||||
is_nil(map[field]) ->
|
||||
Map.put(map, field, [])
|
||||
|
||||
true ->
|
||||
map
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user