]> granicus.if.org Git - ejabberd/commitdiff
Don't emit validator's warning if the module is not found
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>
Mon, 19 Feb 2018 19:07:09 +0000 (22:07 +0300)
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>
Mon, 19 Feb 2018 19:07:09 +0000 (22:07 +0300)
src/gen_mod.erl

index 5f8283df73d5624309cd2ed92a45acbd444d61a2..a477ec2956108c643af19311860c35fcbc7b0d8f 100644 (file)
@@ -516,9 +516,16 @@ get_validators(Host, {Module, SubMods}) ->
        [] ->
            case have_validators(Module) of
                false ->
-                   ?WARNING_MSG("Third-party module '~s' doesn't export "
-                                "options validator; consider to upgrade "
-                                "the module", [Module]),
+                   case code:ensure_loaded(Module) of
+                       {module, _} ->
+                           ?WARNING_MSG("Third-party module '~s' doesn't export "
+                                        "options validator; consider to upgrade "
+                                        "the module", [Module]);
+                       _ ->
+                           %% Silently ignore this, the error will be
+                           %% generated later
+                           ok
+                   end,
                    undef;
                true ->
                    []