activitypub: transmogrifier: correctly handle nil inReplyTo value
authorWilliam Pitcock <nenolod@dereferenced.org>
Thu, 14 Feb 2019 00:34:20 +0000 (00:34 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Thu, 14 Feb 2019 00:35:54 +0000 (00:35 +0000)
lib/pleroma/web/activity_pub/transmogrifier.ex

index 5da65fa39b7d537fe6a834704ef538de37939914..26b2dd575432b29b0868e8f295650af2e74367a3 100644 (file)
@@ -649,7 +649,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
     if object = Object.normalize(id), do: {:ok, object}, else: nil
   end
 
-  def set_reply_to_uri(%{"inReplyTo" => inReplyTo} = object) do
+  def set_reply_to_uri(%{"inReplyTo" => inReplyTo} = object) when is_binary(inReplyTo) do
     with false <- String.starts_with?(inReplyTo, "http"),
          {:ok, %{data: replied_to_object}} <- get_obj_helper(inReplyTo) do
       Map.put(object, "inReplyTo", replied_to_object["external_url"] || inReplyTo)