From: FloatingGhost Date: Fri, 29 Jul 2022 09:04:04 +0000 (+0100) Subject: add guards around fix misskey content X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=bf3f934275cc0e2f957483c3a2ee53f93a191986;p=akkoma add guards around fix misskey content --- 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