Comparison

mod_bookmarks2/mod_bookmarks2.lua @ 3696:310061f6e1df

mod_bookmarks2: Fix traceback on updating from no legacy bookmarks to bookmarks 2.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 28 Sep 2019 14:55:03 +0200
parent 3678:7575399ae544
child 3738:9cd6d602ad1b
comparison
equal deleted inserted replaced
3695:5a70dd2349a7 3696:310061f6e1df
213 213
214 local data, err = private_storage:get(username, "storage:storage:bookmarks"); 214 local data, err = private_storage:get(username, "storage:storage:bookmarks");
215 if not data then 215 if not data then
216 module:log("debug", "No existing legacy bookmarks for %s, migration already done: %s", jid, err); 216 module:log("debug", "No existing legacy bookmarks for %s, migration already done: %s", jid, err);
217 local ok, ret = service:get_items("urn:xmpp:bookmarks:0", session.full_jid); 217 local ok, ret = service:get_items("urn:xmpp:bookmarks:0", session.full_jid);
218 if not ok or #ret.tags == 0 then 218 if not ok or not ret then
219 module:log("debug", "Additionally, no bookmarks 2 were existing for %s, assuming empty.", jid); 219 module:log("debug", "Additionally, no bookmarks 2 were existing for %s, assuming empty.", jid);
220 module:fire_event("bookmarks/empty", { session = session }); 220 module:fire_event("bookmarks/empty", { session = session });
221 end 221 end
222 return; 222 return;
223 end 223 end