[Pleroma.Web.TwitterAPI.UserView]: Do not fail if user.bio is nil
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Tue, 21 Aug 2018 23:47:25 +0000 (01:47 +0200)
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Tue, 21 Aug 2018 23:47:25 +0000 (01:47 +0200)
lib/pleroma/web/twitter_api/views/user_view.ex

index 25fda1aa80af3cf017f9c9977d10d392af122124..712557f770fa2c200d14a55fb68a4cd0bee65071 100644 (file)
@@ -38,7 +38,7 @@ defmodule Pleroma.Web.TwitterAPI.UserView 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],