summaryrefslogtreecommitdiffhomepage
path: root/libs/luci-lib-json
diff options
context:
space:
mode:
Diffstat (limited to 'libs/luci-lib-json')
-rw-r--r--libs/luci-lib-json/luasrc/json.lua12
1 files changed, 7 insertions, 5 deletions
diff --git a/libs/luci-lib-json/luasrc/json.lua b/libs/luci-lib-json/luasrc/json.lua
index 416b25faa..f7b57f916 100644
--- a/libs/luci-lib-json/luasrc/json.lua
+++ b/libs/luci-lib-json/luasrc/json.lua
@@ -149,11 +149,13 @@ function Encoder.parse_iter(self, obj)
local first = true
for key, entry in pairs(obj) do
- first = first or self:put(",")
- first = first and false
- self:parse_string(tostring(key))
- self:put(":")
- self:dispatch(entry)
+ if key ~= null then
+ first = first or self:put(",")
+ first = first and false
+ self:parse_string(tostring(key))
+ self:put(":")
+ self:dispatch(entry)
+ end
end
self:put("}")