Don't crash if you get one of these "{}" entries that 1Password makes.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 08 Jul 2014 23:49:15 -0400
changeset 40 3c2fddfada9f
parent 39 ddb45e88adc9
child 41 5155ff0e6d3d
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
--- a/1pass.lua	Tue Jul 08 23:47:17 2014 -0400
+++ b/1pass.lua	Tue Jul 08 23:49:15 2014 -0400
@@ -246,7 +246,7 @@
 
 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