From 5f9c188a630be39fd622a9ae198f3bee0f041f3b Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 8 Jul 2014 23:49:15 -0400 Subject: [PATCH] Don't crash if you get one of these "{}" entries that 1Password makes. It looks like some version of 1Password has obsolete entries that still have JSON files listed, but the entirety of the JSON is "{}" ... we now check if we got an empty table back from the Lua JSON parser and treat it as a dead entry. --- 1pass.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1pass.lua b/1pass.lua index 92422b2..f5d68fb 100644 --- a/1pass.lua +++ b/1pass.lua @@ -246,7 +246,7 @@ secret_menuitem_builders["securenotes.SecureNote"] = build_secret_menuitem_secur local function build_secret_menuitems(info, menu) local metadata = load_json(basedir .. "/" .. info.uuid .. ".1password") - if metadata == nil then + if (metadata == nil) or (next(metadata) == nil) then -- the "next" trick tests if table is empty. return end