aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-06-09 22:00:01 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-06-09 22:00:01 +0500
commitc7af4d8bf50f45b3b7bdd1450e1e8e87c62c8ca1 (patch)
treeafa98bc6c255e910a0059c3500dd47e79af2a011 /plugins
parent2c2035605842954402e8c730d3b071afedb32d98 (diff)
downloadprosody-c7af4d8bf50f45b3b7bdd1450e1e8e87c62c8ca1.tar.gz
prosody-c7af4d8bf50f45b3b7bdd1450e1e8e87c62c8ca1.zip
mod_presence: Fixed a traceback.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_presence.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/mod_presence.lua b/plugins/mod_presence.lua
index 1380c5c6..3735cf1d 100644
--- a/plugins/mod_presence.lua
+++ b/plugins/mod_presence.lua
@@ -273,7 +273,8 @@ local outbound_presence_handler = function(data)
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?