diff options
author | rinpatch <rinpatch@sdf.org> | 2020-01-30 22:16:55 +0300 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2020-01-30 22:16:55 +0300 |
commit | 5b62acf6e9a38f8d14a9fb37cc85e646fb0169e3 (patch) | |
tree | 6677ba80418ffd34a78cba75498f2c1ab48ba14c /lib/pleroma/web/controller_helper.ex | |
parent | 45180d4c6058f790475d8ff28018c912db105082 (diff) | |
parent | 946de2299cccebac6718e3a132397ff5c06c67ee (diff) | |
download | pleroma-5b62acf6e9a38f8d14a9fb37cc85e646fb0169e3.tar.gz |
Merge branch 'develop' into fix/disable-rate-limiter-for-socket-localhost
Diffstat (limited to 'lib/pleroma/web/controller_helper.ex')
-rw-r--r-- | lib/pleroma/web/controller_helper.ex | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/pleroma/web/controller_helper.ex b/lib/pleroma/web/controller_helper.ex index 9a4e322c9..e3d7a465b 100644 --- a/lib/pleroma/web/controller_helper.ex +++ b/lib/pleroma/web/controller_helper.ex @@ -76,8 +76,7 @@ defmodule Pleroma.Web.ControllerHelper do end end - def try_render(conn, target, params) - when is_binary(target) do + 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 @@ -87,4 +86,8 @@ defmodule Pleroma.Web.ControllerHelper do def try_render(conn, _, _) do render_error(conn, :not_implemented, "Can't display this activity") end + + @spec put_in_if_exist(map(), atom() | String.t(), any) :: map() + def put_in_if_exist(map, _key, nil), do: map + def put_in_if_exist(map, key, value), do: put_in(map, key, value) end |