Skip to content

Commit

Permalink
mod_admin_adhoc: fix traceback if bare_session is nil.
Browse files Browse the repository at this point in the history
  • Loading branch information
maranda committed Jul 24, 2021
1 parent 2b48247 commit 72dada9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/mod_admin_adhoc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ end
function disconnect_user(match_jid)
local node, hostname, givenResource = jid.split(match_jid);
local bare_session = module:get_bare_session(node);
for resource, session in pairs(bare_session.sessions or {}) do
for resource, session in pairs((bare_session and bare_session.sessions) or {}) do
if not givenResource or (resource == givenResource) then
module:log("debug", "Disconnecting %s@%s/%s", node, hostname, resource);
session:close();
Expand Down

0 comments on commit 72dada9

Please # to comment.