changeset 1300:99748c89edd4

mod_manifesto: Fix traceback when user disconnects before the timer (fixes #48)
author Kim Alvefur <zash@zash.se>
date Thu, 06 Feb 2014 19:27:13 +0100
parents a7d6c6d2c7b5
children 6e4ebdc9b46b
files mod_manifesto/mod_manifesto.lua
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_manifesto/mod_manifesto.lua	Tue Feb 04 12:48:33 2014 +0100
+++ b/mod_manifesto/mod_manifesto.lua	Thu Feb 06 19:27:13 2014 +0100
@@ -55,6 +55,7 @@
 	end
 
 	timer.add_task(15, function ()
+		if session.type ~= "c2s" then return end -- user quit already
 		local bad_contacts, bad_hosts = {}, {};
 		for contact_jid, item in pairs(session.roster or {}) do
 			local _, contact_host = jid_split(contact_jid);