From 1662f9263d419dae4d7049f0ae62c4fa09fe5fea Mon Sep 17 00:00:00 2001 From: Cr4xy Date: Thu, 11 Apr 2019 08:02:52 +0200 Subject: [PATCH] Fix bug with keyorder when value is false --- dkjson.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dkjson.lua b/dkjson.lua index b63d5ac..2226251 100644 --- a/dkjson.lua +++ b/dkjson.lua @@ -319,7 +319,7 @@ encode2 = function (value, indent, level, buffer, buflen, tables, globalorder, s for i = 1, n do local k = order[i] local v = value[k] - if v then + if v ~= nil then used[k] = true buflen, msg = addpair (k, v, prev, indent, level, buffer, buflen, tables, globalorder, state) prev = true -- add a seperator before the next element -- 2.45.2