From bf3f934275cc0e2f957483c3a2ee53f93a191986 Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Fri, 29 Jul 2022 10:04:04 +0100 Subject: [PATCH] add guards around fix misskey content --- .../object_validators/article_note_page_validator.ex | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/pleroma/web/activity_pub/object_validators/article_note_page_validator.ex b/lib/pleroma/web/activity_pub/object_validators/article_note_page_validator.ex index 5e377c294..453bc6d86 100644 --- a/lib/pleroma/web/activity_pub/object_validators/article_note_page_validator.ex +++ b/lib/pleroma/web/activity_pub/object_validators/article_note_page_validator.ex @@ -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