# HG changeset patch # User Kim Alvefur # Date 1658770118 -7200 # Node ID 4c8b66da4dec5f5d690cf5db250cdf749078a989 # Parent 3bd725430f40d6bd5f569af55fdc037ea96b987b mod_default_bookmarks: Bail on empty 'default_bookmarks' to fix traceback Ipairs fails on nil if the option is unset Thanks more666p0wer for reporting diff -r 3bd725430f40 -r 4c8b66da4dec mod_default_bookmarks/mod_default_bookmarks.lua --- a/mod_default_bookmarks/mod_default_bookmarks.lua Thu Jul 21 18:06:31 2022 +0200 +++ b/mod_default_bookmarks/mod_default_bookmarks.lua Mon Jul 25 19:28:38 2022 +0200 @@ -80,6 +80,9 @@ end local service = mod_pep.get_pep_service(session.username); local bookmarks = module:get_option_array("default_bookmarks"); + if not bookmarks or #bookmarks == 0 then + return; + end local ns = event.version or "urn:xmpp:bookmarks:1"; for i, bookmark in ipairs(bookmarks) do local bm_jid = jid.prep(bookmark.jid);