Apply suggestion to lib/pleroma/plugs/rate_limiter/rate_limiter.ex
authorIvan Tashkinov <ivantbusiness@gmail.com>
Fri, 28 Feb 2020 13:33:42 +0000 (13:33 +0000)
committerIvan Tashkinov <ivantbusiness@gmail.com>
Fri, 28 Feb 2020 13:33:42 +0000 (13:33 +0000)
lib/pleroma/plugs/rate_limiter/rate_limiter.ex

index d2067060d6e0d1f1113ce125aa713160d25b5ba5..3a27d6eb7e2fbfae008a4282dcbcf885c6780e31 100644 (file)
@@ -144,7 +144,7 @@ defmodule Pleroma.Plugs.RateLimiter do
   end
 
   def action_settings(plug_opts) do
-    with limiter_name when not is_nil(limiter_name) <- plug_opts[:name],
+    with limiter_name when is_atom(limiter_name) <- plug_opts[:name],
          limits when not is_nil(limits) <- Config.get([:rate_limit, limiter_name]) do
       bucket_name_root = Keyword.get(plug_opts, :bucket_name, limiter_name)