From 125249a32245fae805e779976f3737103269e0a6 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 10 Jan 2022 00:13:17 +0100 Subject: mod_bookmarks: Skip migration of legacy data when empty Should save some cycles and not log the debug message on every login. --- plugins/mod_bookmarks.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/mod_bookmarks.lua b/plugins/mod_bookmarks.lua index 10c1abd1..fc37f09a 100644 --- a/plugins/mod_bookmarks.lua +++ b/plugins/mod_bookmarks.lua @@ -335,7 +335,7 @@ local function migrate_legacy_bookmarks(event) local jid = username.."@"..session.host; local ok, ret = service:get_items(namespace_legacy, session.full_jid); - if ok then + if ok and ret[1] then module:log("debug", "Legacy PEP bookmarks found for %s, migrating.", jid); local failed = false; for _, item_id in ipairs(ret) do -- cgit v1.2.3