]> granicus.if.org Git - ejabberd/commitdiff
Use list_to_existing_atom/1 wherever possible
authorEvgeny Khramtsov <ekhramtsov@process-one.net>
Sat, 15 Jun 2019 12:14:45 +0000 (15:14 +0300)
committerEvgeny Khramtsov <ekhramtsov@process-one.net>
Sat, 15 Jun 2019 12:14:45 +0000 (15:14 +0300)
src/ejabberd_cluster.erl
src/ejabberd_oauth.erl
src/ejabberd_router.erl
src/ejabberd_sm.erl
src/gen_mod.erl

index bf420e0f7fb8607a43d0a5a923413d87d14c40db..e2b02f7f804ac7fb17603549e5a64ba33beccb0d 100644 (file)
@@ -194,7 +194,7 @@ code_change(_OldVsn, State, _Extra) ->
 %%%===================================================================
 get_mod() ->
     Backend = ejabberd_option:cluster_backend(),
-    list_to_atom("ejabberd_cluster_" ++ atom_to_list(Backend)).
+    list_to_existing_atom("ejabberd_cluster_" ++ atom_to_list(Backend)).
 
 rpc_timeout() ->
     ejabberd_option:rpc_timeout().
index 5a18f02f8496971e3b10b0353819bbefb7c60808..1d03626e7d67dc5eb0d14b6656133c6056fb9179 100644 (file)
@@ -565,7 +565,7 @@ process(_Handlers, _Request) ->
 
 get_db_backend() ->
     DBType = ejabberd_option:oauth_db_type(),
-    list_to_atom("ejabberd_oauth_" ++ atom_to_list(DBType)).
+    list_to_existing_atom("ejabberd_oauth_" ++ atom_to_list(DBType)).
 
 
 %% Headers as per RFC 6749
index 4a2a6bd3049dd06b91481b5d18edc9d0d3cb73c2..325dd75f3d91eb765a9840eb1b92df6756d4c790 100644 (file)
@@ -429,7 +429,7 @@ get_domain_balancing(From, To, LDomain) ->
 -spec get_backend() -> module().
 get_backend() ->
     DBType = ejabberd_option:router_db_type(),
-    list_to_atom("ejabberd_router_" ++ atom_to_list(DBType)).
+    list_to_existing_atom("ejabberd_router_" ++ atom_to_list(DBType)).
 
 -spec cache_nodes(module()) -> [node()].
 cache_nodes(Mod) ->
index f0c705aae337cbdfac57fce34e8b2abb39cbaa32..f0a10e5fad7ac7d7478f8c6bd169c94927bb4988 100644 (file)
@@ -881,7 +881,7 @@ force_update_presence({LUser, LServer}) ->
 
 get_sm_backend(Host) ->
     DBType = ejabberd_option:sm_db_type(Host),
-    list_to_atom("ejabberd_sm_" ++ atom_to_list(DBType)).
+    list_to_existing_atom("ejabberd_sm_" ++ atom_to_list(DBType)).
 
 -spec get_sm_backends() -> [module()].
 
index f0a35e316fcef3983d37ef865ba3dea1a113a434..2e590d06640607c8cba3eab94ca7b9ef2bd1bc5f 100644 (file)
@@ -353,7 +353,7 @@ db_mod(Opt, Host, Module) when is_binary(Host) orelse Host == global ->
 db_mod(Opt, Opts, Module) when is_map(Opts) ->
     db_mod(Opt, get_opt(Opt, Opts), Module);
 db_mod(_Opt, Type, Module) when is_atom(Type) ->
-    list_to_atom(atom_to_list(Module) ++ "_" ++ atom_to_list(Type)).
+    list_to_existing_atom(atom_to_list(Module) ++ "_" ++ atom_to_list(Type)).
 
 -spec loaded_modules(binary()) -> [atom()].
 loaded_modules(Host) ->