# HG changeset patch # User Matthew Wild # Date 1266510170 0 # Node ID ba6dd11f7259bbbb935e7a4eb7e244231174bde3 # Parent 9fab590093979cb1c2e725a7c656e63346c4ea1e modulemanager: Fix traceback on unloading global modules (thanks KSid) diff -r 9fab59009397 -r ba6dd11f7259 core/modulemanager.lua --- a/core/modulemanager.lua Wed Feb 17 13:21:33 2010 +0000 +++ b/core/modulemanager.lua Thu Feb 18 16:22:50 2010 +0000 @@ -158,7 +158,7 @@ log("error", "Error initializing module '%s' on '%s': %s", module_name, host, err or "nil"); end if success then - hosts[host].events.fire_event("module-loaded", { module = module_name, host = host }); + (hosts[api_instance.host] or prosody).events.fire_event("module-loaded", { module = module_name, host = host }); return true; else -- load failed, unloading unload(api_instance.host, module_name); @@ -210,7 +210,7 @@ end end modulemap[host][name] = nil; - hosts[host].events.fire_event("module-unloaded", { module = name, host = host }); + (hosts[host] or prosody).events.fire_event("module-unloaded", { module = name, host = host }); return true; end