aboutsummaryrefslogtreecommitdiffstats
path: root/util/json.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2016-03-04 22:27:04 +0000
committerMatthew Wild <mwild1@gmail.com>2016-03-04 22:27:04 +0000
commitdf618247d3fb899b69668dfcc084a154e04c34c6 (patch)
treec2a7bba22ba97919185210e5102bdc8d454b84a3 /util/json.lua
parent61688d5064b462ba9bef976de760d7244cce1826 (diff)
downloadprosody-df618247d3fb899b69668dfcc084a154e04c34c6.tar.gz
prosody-df618247d3fb899b69668dfcc084a154e04c34c6.zip
util.json: Fix encoding of json.null (bug introduced in bf1f09a5bcf7)
Diffstat (limited to 'util/json.lua')
-rw-r--r--util/json.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/util/json.lua b/util/json.lua
index becd295d..2c598446 100644
--- a/util/json.lua
+++ b/util/json.lua
@@ -145,7 +145,9 @@ end
function simplesave(o, buffer)
local t = type(o);
- if t == "number" then
+ if o == null then
+ t_insert(buffer, "null");
+ elseif t == "number" then
t_insert(buffer, tostring(o));
elseif t == "string" then
stringsave(o, buffer);