add guards around fix misskey content
authorFloatingGhost <hannah@coffee-and-dreams.uk>
Fri, 29 Jul 2022 09:04:04 +0000 (10:04 +0100)
committerFloatingGhost <hannah@coffee-and-dreams.uk>
Fri, 29 Jul 2022 09:04:04 +0000 (10:04 +0100)
lib/pleroma/web/activity_pub/object_validators/article_note_page_validator.ex

index 5e377c2946d7faa10eefb875c288fe071bdc5028..453bc6d862474a17c74553e350abe6aa0f5da398 100644 (file)
@@ -110,7 +110,8 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.ArticleNotePageValidator do
   # https://github.com/misskey-dev/misskey/pull/8787
   defp fix_misskey_content(
          %{"source" => %{"mediaType" => "text/x.misskeymarkdown", "content" => content}} = object
-       ) do
+       )
+       when is_binary(content) do
     mention_handler = fn nick, buffer, opts, acc ->
       remote_mention_resolver(object, nick, buffer, opts, acc)
     end
@@ -121,7 +122,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.ArticleNotePageValidator do
     Map.put(object, "content", linked)
   end
 
-  defp fix_misskey_content(%{"_misskey_content" => content} = object) do
+  defp fix_misskey_content(%{"_misskey_content" => content} = object) when is_binary(content) do
     mention_handler = fn nick, buffer, opts, acc ->
       remote_mention_resolver(object, nick, buffer, opts, acc)
     end