1
0
Fork 1
mirror of https://akkoma.dev/AkkomaGang/akkoma.git synced 2024-11-18 02:49:18 +00:00

[Pleroma.Web.TwitterAPI.UserView]: Do not fail if user.bio is nil

This commit is contained in:
Haelwenn (lanodan) Monnier 2018-08-22 01:47:25 +02:00
parent 5dde6e4a00
commit d5bdd55b5d
No known key found for this signature in database
GPG key ID: D5B7A8E43C997DEE

View file

@ -38,7 +38,7 @@ def render("user.json", %{user: user = %User{}} = assigns) do
data = %{
"created_at" => user.inserted_at |> Utils.format_naive_asctime(),
"description" => HtmlSanitizeEx.strip_tags(user.bio |> String.replace("<br>", "\n")),
"description" => HtmlSanitizeEx.strip_tags((user.bio || "") |> String.replace("<br>", "\n")),
"description_html" => HtmlSanitizeEx.basic_html(user.bio),
"favourites_count" => 0,
"followers_count" => user_info[:follower_count],