Changeset

7235:ee1f7e1e548c

util.json: Fix encoding of json.null (bug introduced in bf1f09a5bcf7)
author Matthew Wild <mwild1@gmail.com>
date Fri, 04 Mar 2016 22:27:04 +0000
parents 7234:161f9f163e37
children 7236:3304a04281d6 7237:472736b583fb
files util/json.lua
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/util/json.lua	Fri Mar 04 22:17:38 2016 +0000
+++ b/util/json.lua	Fri Mar 04 22:27:04 2016 +0000
@@ -145,7 +145,9 @@
 
 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);