add fallback for no content

This commit is contained in:
FloatingGhost 2022-12-14 11:52:35 +00:00
parent 2ace212473
commit d7f1421d2c
1 changed files with 4 additions and 0 deletions

View File

@ -30,6 +30,10 @@ defmodule Pleroma.Web.Metadata.Utils do
|> scrub_html_and_truncate_object_field(object)
end
def scrub_html_and_truncate(%{data: _}) do
""
end
def scrub_html_and_truncate(content, max_length \\ 200) when is_binary(content) do
content
|> scrub_html