Skip to content

Commit

Permalink
fix init when no config is given
Browse files Browse the repository at this point in the history
Signed-off-by: Alejandro M. Ramallo <[email protected]>
  • Loading branch information
aramallo committed Oct 1, 2023
1 parent d96c7c4 commit f1957a2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/partisan_peer_discovery_agent.erl
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,12 @@ init([#{enabled := true, type := Mod} = Opts]) when is_atom(Mod) ->
init([#{enabled := true} = Opts]) ->
{stop, {invalid_config, Opts}};

init(#{}) ->
State = #state{enabled = false},
{ok, disabled, State};

init([Opts]) when is_list(Opts) ->
init([maps:from_list(Opts)]).
init([maps:from_list(Opts)]);

init(_) ->
State = #state{enabled = false},
{ok, disabled, State}.


callback_mode() ->
Expand Down

0 comments on commit f1957a2

Please sign in to comment.