# HG changeset patch # User Matthew Wild # Date 1236099269 0 # Node ID 49298263f24182db107c2061f9651581d204072b # Parent 946d0f91bd381a5cc514c5ee290000cece0ea98b core.configmanager: Small fix to check validity of Component definitions diff -r 946d0f91bd38 -r 49298263f241 core/configmanager.lua --- a/core/configmanager.lua Mon Mar 02 19:50:28 2009 +0000 +++ b/core/configmanager.lua Tue Mar 03 16:54:29 2009 +0000 @@ -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 @@ 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;