aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-10-13 14:54:07 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-10-13 14:54:07 +0500
commit193278754c23997fcbf1c7010ec6ac8da72cce90 (patch)
tree69901675aae66f3e41a265723b8608b7feae54d0
parent73a4154d03944f43413c5e85d7e3adc5803ca10a (diff)
downloadprosody-193278754c23997fcbf1c7010ec6ac8da72cce90.tar.gz
prosody-193278754c23997fcbf1c7010ec6ac8da72cce90.zip
rostermanager: Fixed a traceback on roster save.
-rw-r--r--core/rostermanager.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/rostermanager.lua b/core/rostermanager.lua
index 33fcf97a..ddff841e 100644
--- a/core/rostermanager.lua
+++ b/core/rostermanager.lua
@@ -112,9 +112,9 @@ function save_roster(username, host, roster)
--end
end
if roster then
- local roster = hosts[host].sessions[username].roster;
- roster[false].version = (roster[false].version or 1) + 1;
- return datamanager.store(username, host, "roster", hosts[host].sessions[username].roster);
+ if not roster[false] then roster[false] = {}; end
+ roster[false].version = (roster[false].version or 0) + 1;
+ return datamanager.store(username, host, "roster", roster);
end
log("warn", "save_roster: user had no roster to save");
return nil;