forked from AkkomaGang/akkoma
activitypub: transmogrifier: do not allow missing lists to be interpreted as nil
This commit is contained in:
parent
798da28812
commit
d487b753c3
1 changed files with 9 additions and 5 deletions
|
@ -86,11 +86,15 @@ def fix_object(object) do
|
||||||
end
|
end
|
||||||
|
|
||||||
def fix_addressing_list(map, field) do
|
def fix_addressing_list(map, field) do
|
||||||
if is_binary(map[field]) do
|
cond do
|
||||||
map
|
is_binary(map[field]) ->
|
||||||
|> Map.put(field, [map[field]])
|
Map.put(map, field, [map[field]])
|
||||||
else
|
|
||||||
map
|
is_nil(map[field]) ->
|
||||||
|
Map.put(map, field, [])
|
||||||
|
|
||||||
|
true ->
|
||||||
|
map
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue