logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: 4fc177eb460c14dc1e8f4eedcbce95c242eef60d
parent 251c455b9129b328d3266cc3d68434b0d879f864
Author: Mark Felder <feld@feld.me>
Date:   Mon, 29 Jan 2024 16:42:48 -0500

Pleroma.Web.ControllerHelper: dialyzer error

lib/pleroma/web/controller_helper.ex:97:pattern_match
The pattern can never match the type.

Pattern:
nil

Type:
%Plug.Conn{
  :adapter => {atom(), _},
  :assigns => %{atom() => _},
  :body_params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :halted => boolean(),
  :host => binary(),
  :method => binary(),
  :owner => pid(),
  :params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :path_info => [binary()],
  :path_params => %{
    binary() =>
      binary()
      | [binary() | [any()] | %{binary() => _}]
      | %{binary() => binary() | [any()] | %{binary() => _}}
  },
  :port => char(),
  :private => %{atom() => _},
  :query_params => %Plug.Conn.Unfetched{
    :aspect => atom(),
    binary() =>
      binary()
      | [binary() | [any()] | %{binary() => _}]
      | %{binary() => binary() | [any()] | %{binary() => _}}
  },
  :query_string => binary(),
  :remote_ip =>
    {byte(), byte(), byte(), byte()}
    | {char(), char(), char(), char(), char(), char(), char(), char()},
  :req_cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => binary()},
  :req_headers => [{binary(), binary()}],
  :request_path => binary(),
  :resp_body =>
    nil
    | binary()
    | maybe_improper_list(
        binary() | maybe_improper_list(any(), binary() | []) | byte(),
        binary() | []
      ),
  :resp_cookies => %{binary() => map()},
  :resp_headers => [{binary(), binary()}],
  :scheme => :http | :https,
  :script_name => [binary()],
  :secret_key_base => nil | binary(),
  :state => :sent,
  :status => nil | non_neg_integer()
}

Diffstat:

Mlib/pleroma/web/controller_helper.ex5+----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/lib/pleroma/web/controller_helper.ex b/lib/pleroma/web/controller_helper.ex @@ -93,10 +93,7 @@ defmodule Pleroma.Web.ControllerHelper do end def try_render(conn, target, params) when is_binary(target) do - case render(conn, target, params) do - nil -> render_error(conn, :not_implemented, "Can't display this activity") - res -> res - end + render(conn, target, params) end def try_render(conn, _, _) do