Cope with modules that don't export mod_opt_type/1

This commit is contained in:
Holger Weiss 2016-05-01 22:06:15 +02:00
parent b202004862
commit b46ed7044a
1 changed files with 2 additions and 2 deletions

View File

@ -301,7 +301,7 @@ validate_opts(Module, Opts) ->
db_type(Opts, Module) when is_list(Opts) ->
db_type(global, Opts, Module);
db_type(Host, Module) when is_atom(Module) ->
case Module:mod_opt_type(db_type) of
case catch Module:mod_opt_type(db_type) of
F when is_function(F) ->
case get_module_opt(Host, Module, db_type, F) of
undefined -> ejabberd_config:default_db(Host, Module);
@ -314,7 +314,7 @@ db_type(Host, Module) when is_atom(Module) ->
-spec db_type(binary(), opts(), module()) -> db_type().
db_type(Host, Opts, Module) ->
case Module:mod_opt_type(db_type) of
case catch Module:mod_opt_type(db_type) of
F when is_function(F) ->
case get_opt(db_type, Opts, F) of
undefined -> ejabberd_config:default_db(Host, Module);