aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/componentmanager.lua2
-rw-r--r--core/modulemanager.lua8
2 files changed, 6 insertions, 4 deletions
diff --git a/core/componentmanager.lua b/core/componentmanager.lua
index afed1df3..f8db2d2c 100644
--- a/core/componentmanager.lua
+++ b/core/componentmanager.lua
@@ -58,7 +58,7 @@ function register_component(host, component)
end
end
-function deregister_component(host, component)
+function deregister_component(host)
if components[host] then
module_unload(host, "dialback");
components[host] = nil;
diff --git a/core/modulemanager.lua b/core/modulemanager.lua
index 6ef39e82..52fbc65d 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;