projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'language-on-posts' into develop
[akkoma]
/
lib
/
pleroma
/
web
/
activity_pub
/
transmogrifier.ex
diff --git
a/lib/pleroma/web/activity_pub/transmogrifier.ex
b/lib/pleroma/web/activity_pub/transmogrifier.ex
index 77015241be0674fcb75ddf5fdbb15839bac2646d..2ff0e8a7444b0367d4f630c69f83c9d95f820922 100644
(file)
--- a/
lib/pleroma/web/activity_pub/transmogrifier.ex
+++ b/
lib/pleroma/web/activity_pub/transmogrifier.ex
@@
-346,11
+346,16
@@
defmodule Pleroma.Web.ActivityPub.Transmogrifier do
def fix_tag(object), do: object
# content map usually only has one language so this will do for now.
def fix_tag(object), do: object
# content map usually only has one language so this will do for now.
- def fix_content_map(%{"contentMap" => content_map} = object) do
+ def fix_content_map(%{"contentMap" => content_map} = object)
when is_map(content_map)
do
content_groups = Map.to_list(content_map)
content_groups = Map.to_list(content_map)
- {_, content} = Enum.at(content_groups, 0)
- Map.put(object, "content", content)
+ if Enum.empty?(content_groups) do
+ object
+ else
+ {_, content} = Enum.at(content_groups, 0)
+
+ Map.put(object, "content", content)
+ end
end
def fix_content_map(object), do: object
end
def fix_content_map(object), do: object