Changeset

708:b72d408f5f15

modulemanager: Fixed error on unloading modules with no handlers
author Waqas Hussain <waqas20@gmail.com>
date Tue, 13 Jan 2009 20:19:52 +0500
parents 707:bb9583314ec7
children 709:8bb83563cb21
files core/modulemanager.lua
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/core/modulemanager.lua	Tue Jan 13 20:18:20 2009 +0500
+++ b/core/modulemanager.lua	Tue Jan 13 20:19:52 2009 +0500
@@ -149,10 +149,12 @@
 	modulemap[host][name] = nil;
 	features_table:remove(host, name);
 	local params = handler_table:get(host, name); -- , {module.host, origin_type, tag, xmlns}
-	for _, param in pairs(params) do
+	for _, param in pairs(params or NULL) do
 		local handlers = stanza_handlers:get(param[1], param[2], param[3], param[4]);
-		handler_info[handlers[1]] = nil;
-		stanza_handlers:remove(param[1], param[2], param[3], param[4]);
+		if handlers then
+			handler_info[handlers[1]] = nil;
+			stanza_handlers:remove(param[1], param[2], param[3], param[4]);
+		end
 	end
 	event_hooks:remove(host, name);
 	return true;