Twitter ActivityView: fix crash when activity content is nil
authorhref <href@random.sh>
Tue, 18 Dec 2018 14:32:41 +0000 (15:32 +0100)
committerhref <href@random.sh>
Tue, 18 Dec 2018 14:34:27 +0000 (15:34 +0100)
lib/pleroma/web/twitter_api/views/activity_view.ex

index 91d0867408d3c75fc4ca1755777a93e3a26c9e7d..bc90a1cd452405317cb9f61f2ac096a77e436ca6 100644 (file)
@@ -245,9 +245,11 @@ defmodule Pleroma.Web.TwitterAPI.ActivityView do
       |> Formatter.emojify(object["emoji"])
 
     text =
-      content
-      |> String.replace(~r/<br\s?\/?>/, "\n")
-      |> HTML.strip_tags()
+      if content do
+        content
+        |> String.replace(~r/<br\s?\/?>/, "\n")
+        |> HTML.strip_tags()
+      end
 
     reply_parent = Activity.get_in_reply_to_activity(activity)