Handle non-list keys in Config.fetch/1
This commit is contained in:
parent
2299bfe4c1
commit
8c57a299b4
2 changed files with 4 additions and 0 deletions
|
|
@ -32,6 +32,8 @@ defmodule Pleroma.Config do
|
|||
end
|
||||
end
|
||||
|
||||
def fetch(key) when is_atom(key), do: fetch([key])
|
||||
|
||||
def fetch([root_key | keys]) do
|
||||
Enum.reduce_while(keys, Application.fetch_env(:pleroma, root_key), fn
|
||||
key, {:ok, config} when is_map(config) or is_list(config) ->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue