From 193278754c23997fcbf1c7010ec6ac8da72cce90 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Tue, 13 Oct 2009 14:54:07 +0500 Subject: rostermanager: Fixed a traceback on roster save. --- core/rostermanager.lua | 6 +++--- 1 file 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; -- cgit v1.2.3