Diff

mod_smacks/mod_smacks.lua @ 812:0095b74a3685

mod_smacks: Avoid indexing a nil value
author Kim Alvefur <zash@zash.se>
date Wed, 12 Sep 2012 18:03:55 +0200
parent 811:e2d940d81613
child 891:e089160c424b
line wrap: on
line diff
--- a/mod_smacks/mod_smacks.lua	Mon Sep 10 21:11:04 2012 +0200
+++ b/mod_smacks/mod_smacks.lua	Wed Sep 12 18:03:55 2012 +0200
@@ -225,7 +225,7 @@
 				-- (for example, the client may have bound a new resource and
 				-- started a new smacks session, or not be using smacks)
 				local curr_session = full_sessions[session.full_jid];
-				if curr_session.resumption_token == resumption_token
+				if curr_session and curr_session.resumption_token == resumption_token
 				-- Check the hibernate time still matches what we think it is,
 				-- otherwise the session resumed and re-hibernated.
 				and session.hibernating == hibernate_time then