mod_presence: Fixed a traceback.

Wed, 09 Jun 2010 22:00:01 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Wed, 09 Jun 2010 22:00:01 +0500
changeset 3215
e55782f20679
parent 3214
a69d8021b1db
child 3216
d4d0519cd0c1

mod_presence: Fixed a traceback.

plugins/mod_presence.lua file | annotate | diff | comparison | revisions
--- a/plugins/mod_presence.lua	Wed Jun 09 21:34:32 2010 +0500
+++ b/plugins/mod_presence.lua	Wed Jun 09 22:00:01 2010 +0500
@@ -273,7 +273,8 @@
 		end
 
 		local to_bare = jid_bare(to);
-		if not(origin.roster[to_bare] and (origin.roster[to_bare].subscription == "both" or origin.roster[to_bare].subscription == "from")) then -- directed presence
+		local roster = origin.roster;
+		if roster and not(roster[to_bare] and (roster[to_bare].subscription == "both" or roster[to_bare].subscription == "from")) then -- directed presence
 			origin.directed = origin.directed or {};
 			if t then -- removing from directed presence list on sending an error or unavailable
 				origin.directed[to] = nil; -- FIXME does it make more sense to add to_bare rather than to?

mercurial