logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: 5e8bedcca0ebac6fc92733c4e3a95842c850165b
parent ed2f8e45e9118177727b22f103f3c20476a891cf
Author: Mark Felder <feld@feld.me>
Date:   Wed, 31 Jan 2024 11:15:48 -0500

Pleroma.Web.PleromaAPI.MascotController: fix dialyzer error due to bad error match

lib/pleroma/web/pleroma_api/controllers/mascot_controller.ex:37:pattern_match
The pattern can never match the type.

Pattern:
{:content_type, _}

Type:
{:error, _}

________________________________________________________________________________
lib/pleroma/web/pleroma_api/controllers/mascot_controller.ex:40:pattern_match
The pattern can never match the type.

Pattern:
{:upload, {:error, _}}

Type:
{:error, _}

Diffstat:

Mlib/pleroma/web/pleroma_api/controllers/mascot_controller.ex2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/pleroma/web/pleroma_api/controllers/mascot_controller.ex b/lib/pleroma/web/pleroma_api/controllers/mascot_controller.ex @@ -28,7 +28,7 @@ defmodule Pleroma.Web.PleromaAPI.MascotController do _ ) do with {:content_type, "image" <> _} <- {:content_type, file.content_type}, - {:ok, object} <- ActivityPub.upload(file, actor: User.ap_id(user)) do + {_, {:ok, object}} <- {:upload, ActivityPub.upload(file, actor: User.ap_id(user))} do attachment = render_attachment(object) {:ok, _user} = User.mascot_update(user, attachment)