Comparison

core/modulemanager.lua @ 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
parent 686:13ed38531f69
child 709:8bb83563cb21
comparison
equal deleted inserted replaced
707:bb9583314ec7 708:b72d408f5f15
147 end 147 end
148 end 148 end
149 modulemap[host][name] = nil; 149 modulemap[host][name] = nil;
150 features_table:remove(host, name); 150 features_table:remove(host, name);
151 local params = handler_table:get(host, name); -- , {module.host, origin_type, tag, xmlns} 151 local params = handler_table:get(host, name); -- , {module.host, origin_type, tag, xmlns}
152 for _, param in pairs(params) do 152 for _, param in pairs(params or NULL) do
153 local handlers = stanza_handlers:get(param[1], param[2], param[3], param[4]); 153 local handlers = stanza_handlers:get(param[1], param[2], param[3], param[4]);
154 handler_info[handlers[1]] = nil; 154 if handlers then
155 stanza_handlers:remove(param[1], param[2], param[3], param[4]); 155 handler_info[handlers[1]] = nil;
156 stanza_handlers:remove(param[1], param[2], param[3], param[4]);
157 end
156 end 158 end
157 event_hooks:remove(host, name); 159 event_hooks:remove(host, name);
158 return true; 160 return true;
159 end 161 end
160 162