Dialyzer: guard clause can never succeed

lib/pleroma/web/activity_pub/mrf/dnsrbl_policy.ex:106:guard_fail
The guard clause:

when _ ::
  [
    binary()
    | [string() | char()]
    | {string() | integer(), string()}
    | {{byte(), byte(), byte(), byte()}, integer(), binary()}
    | {integer(), integer(), integer(), string() | byte()}
    | {integer(), integer(), string(), string(), string(), string()}
    | {string(), string(), integer(), integer(), integer(), integer(), integer()}
    | {char(), char(), char(), char(), char(), char(), char(), char()}
  ] === nil

can never succeed.
This commit is contained in:
Mark Felder 2024-05-28 09:30:19 -04:00
parent 42c5f7c74e
commit f8ce639e3f

View File

@ -103,7 +103,11 @@ defmodule Pleroma.Web.ActivityPub.MRF.DNSRBLPolicy do
{:ok, object} {:ok, object}
else else
Task.start(fn -> Task.start(fn ->
reason = rblquery(query, :txt) || "undefined" reason =
case rblquery(query, :txt) do
[[result]] -> result
_ -> "undefined"
end
Logger.warning( Logger.warning(
"DNSRBL Rejected activity from #{actor_host} for reason: #{inspect(reason)}" "DNSRBL Rejected activity from #{actor_host} for reason: #{inspect(reason)}"