Fix for checking components, but we need to look at this whole block to optimise...
authorMatthew Wild <mwild1@gmail.com>
Sat, 8 Nov 2008 00:10:01 +0000 (00:10 +0000)
committerMatthew Wild <mwild1@gmail.com>
Sat, 8 Nov 2008 00:10:01 +0000 (00:10 +0000)
core/stanza_router.lua

index 68a71d3b16d7c07d82bf82295e55231cc050d6af..0ce5dd69f09094a91b2635b032d01f6c1037c2d5 100644 (file)
@@ -81,7 +81,7 @@ function core_process_stanza(origin, stanza)
                component_handle_stanza(origin, stanza);
        elseif hosts[to] and hosts[to].type == "component" then -- hack to allow components to handle node@server/resource and server/resource
                component_handle_stanza(origin, stanza);
-       elseif hosts[host].type == "component" then -- directed at a component
+       elseif hosts[host] and hosts[host].type == "component" then -- directed at a component
                component_handle_stanza(origin, stanza);
        elseif origin.type == "c2s" and stanza.name == "presence" and stanza.attr.type ~= nil and stanza.attr.type ~= "unavailable" then
                handle_outbound_presence_subscriptions_and_probes(origin, stanza, from_bare, to_bare);