Changeset

1970:edab0c61fc02

componentmanager: Handle missing prosody object (helps us pass some tests)
author Matthew Wild <mwild1@gmail.com>
date Sat, 17 Oct 2009 13:31:39 +0100
parents 1969:805f548aa57b
children 1971:91420df04d5b
files core/componentmanager.lua
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/core/componentmanager.lua	Sat Oct 17 10:54:28 2009 +0100
+++ b/core/componentmanager.lua	Sat Oct 17 13:31:39 2009 +0100
@@ -6,7 +6,7 @@
 -- COPYING file in the source package for more information.
 --
 
-local prosody = prosody;
+local prosody = _G.prosody;
 local log = require "util.logger".init("componentmanager");
 local configmanager = require "core.configmanager";
 local modulemanager = require "core.modulemanager";
@@ -51,7 +51,9 @@
 	end
 end
 
-prosody.events.add_handler("server-starting", load_enabled_components);
+if prosody and prosody.events then
+	prosody.events.add_handler("server-starting", load_enabled_components);
+end
 
 function handle_stanza(origin, stanza)
 	local node, host = jid_split(stanza.attr.to);