From b194fd5c99a79c55fae3f992e01fb05658c5a7cf Mon Sep 17 00:00:00 2001 From: Sonny Scroggin Date: Tue, 18 Mar 2014 11:23:25 -0500 Subject: [PATCH] Just return the value if it exists, otherwise return the default. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The guard here caused the ‘EXIT’ clause to be triggered in `ejabberd_config:prepare_opt_val/4` on line 573 of `ejabberd_config.erl`. --- mod_rest/src/mod_rest.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod_rest/src/mod_rest.erl b/mod_rest/src/mod_rest.erl index fab4a59..efbb982 100644 --- a/mod_rest/src/mod_rest.erl +++ b/mod_rest/src/mod_rest.erl @@ -111,7 +111,7 @@ try_get_option(Host, OptionName, DefaultValue) -> true -> ok; _ -> throw({module_must_be_started_in_vhost, ?MODULE, Host}) end, - gen_mod:get_module_opt(Host, ?MODULE, OptionName, fun(I) when I -> I end, DefaultValue). + gen_mod:get_module_opt(Host, ?MODULE, OptionName, fun(I) -> I end, DefaultValue). get_option_access(Host) -> try_get_option(Host, access_commands, []).