aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-03-03 16:54:29 +0000
committerMatthew Wild <mwild1@gmail.com>2009-03-03 16:54:29 +0000
commit3b28c0783e0ebc1a76b8142237b808bd47c8e12f (patch)
treeb176808a2c20d92e76c02650f6af0c9c565c152d /core
parentb6b9906c3c653935b55ad79ad4a2c41118f0a0e3 (diff)
downloadprosody-3b28c0783e0ebc1a76b8142237b808bd47c8e12f.tar.gz
prosody-3b28c0783e0ebc1a76b8142237b808bd47c8e12f.zip
core.configmanager: Small fix to check validity of Component definitions
Diffstat (limited to 'core')
-rw-r--r--core/configmanager.lua14
1 files changed, 8 insertions, 6 deletions
diff --git a/core/configmanager.lua b/core/configmanager.lua
index 049862c2..036b6b21 100644
--- a/core/configmanager.lua
+++ b/core/configmanager.lua
@@ -9,8 +9,8 @@
local _G = _G;
-local setmetatable, loadfile, pcall, rawget, rawset, io, error, dofile =
- setmetatable, loadfile, pcall, rawget, rawset, io, error, dofile;
+local setmetatable, loadfile, pcall, rawget, rawset, io, error, dofile, type =
+ setmetatable, loadfile, pcall, rawget, rawset, io, error, dofile, type;
module "configmanager"
@@ -117,10 +117,12 @@ do
function env.Component(name)
return function (module)
- set(name, "core", "component_module", module);
- -- Don't load the global modules by default
- set(name, "core", "modules_enable", false);
- rawset(env, "__currenthost", name);
+ if type(module) == "string" then
+ set(name, "core", "component_module", module);
+ -- Don't load the global modules by default
+ set(name, "core", "modules_enable", false);
+ rawset(env, "__currenthost", name);
+ end
end
end
env.component = env.Component;