X-Git-Url: https://git.archive.openwrt.org/?a=blobdiff_plain;f=libs%2Fluci-lib-json%2Fluasrc%2Fjson.lua;h=f7b57f916c1e7c7d62a30dd62a1fa5e52ee4c7b5;hb=304eec2ebaf983fd067e5ae719f8ec023aad8b30;hp=416b25faa5074c17ef233b3db39b9c845096db02;hpb=a835fc013b1420666e2a437b963ef7c5f07aea69;p=project%2Fluci.git 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("}")