From 3b28c0783e0ebc1a76b8142237b808bd47c8e12f Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Tue, 3 Mar 2009 16:54:29 +0000 Subject: core.configmanager: Small fix to check validity of Component definitions --- core/configmanager.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'core/configmanager.lua') 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; -- cgit v1.2.3