changeset 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
parents 5a70dd2349a7
children a07bd12fe554
files mod_bookmarks2/mod_bookmarks2.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_bookmarks2/mod_bookmarks2.lua	Sun Oct 06 17:29:22 2019 +0200
+++ b/mod_bookmarks2/mod_bookmarks2.lua	Sat Sep 28 14:55:03 2019 +0200
@@ -215,7 +215,7 @@
 	if not data then
 		module:log("debug", "No existing legacy bookmarks for %s, migration already done: %s", jid, err);
 		local ok, ret = service:get_items("urn:xmpp:bookmarks:0", session.full_jid);
-		if not ok or #ret.tags == 0 then
+		if not ok or not ret then
 			module:log("debug", "Additionally, no bookmarks 2 were existing for %s, assuming empty.", jid);
 			module:fire_event("bookmarks/empty", { session = session });
 		end