aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-01-13 20:19:52 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-01-13 20:19:52 +0500
commitbb7d8604f252ce84bdea1cb791114dfc40c5a958 (patch)
treeea32f458d9485560c95ac434d576dd59b2f52204 /core
parente101b6d220b027be538025f634f6ac532fd93bed (diff)
downloadprosody-bb7d8604f252ce84bdea1cb791114dfc40c5a958.tar.gz
prosody-bb7d8604f252ce84bdea1cb791114dfc40c5a958.zip
modulemanager: Fixed error on unloading modules with no handlers
Diffstat (limited to 'core')
-rw-r--r--core/modulemanager.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/modulemanager.lua b/core/modulemanager.lua
index 7c1bc0d8..efb909ac 100644
--- a/core/modulemanager.lua
+++ b/core/modulemanager.lua
@@ -149,10 +149,12 @@ function unload(host, name, ...)
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;