mod_c2s: Fix traceback if c2s stream sent to component
authorKim Alvefur <zash@zash.se>
Sat, 10 May 2014 00:12:51 +0000 (02:12 +0200)
committerKim Alvefur <zash@zash.se>
Sat, 10 May 2014 00:12:51 +0000 (02:12 +0200)
plugins/mod_c2s.lua

index b2a815920dd8bb5097024556935bb950c844f5fb..5feb1f2ce452f278300a1b6942493a5f2227380d 100644 (file)
@@ -50,7 +50,7 @@ function stream_callbacks.streamopened(session, attr)
        session.streamid = uuid_generate();
        (session.log or session)("debug", "Client sent opening <stream:stream> to %s", session.host);
 
-       if not hosts[session.host] then
+       if not hosts[session.host] or not hosts[session.host].users then
                -- We don't serve this host...
                session:close{ condition = "host-unknown", text = "This server does not serve "..tostring(session.host)};
                return;