Skip to content

Commit 9b60819

Browse files
authored
Merge pull request #5228 from myk002/myk_json
Update json lib and change return for empty input
2 parents c1ddbde + ff0c2b6 commit 9b60819

2 files changed

Lines changed: 965 additions & 149 deletions

File tree

library/lua/json.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
local _ENV = mkmodule('json')
2-
local internal = require 'json.internal'
2+
3+
local internal = require('json.internal')
34
local fs = dfhack.filesystem
45

56
encode_defaults = {
@@ -39,7 +40,7 @@ function decode_file(path, ...)
3940
end
4041
local contents = f:read('*all')
4142
f:close()
42-
return decode(contents, ...)
43+
return decode(contents, ...) or {}
4344
end
4445

4546
local _file = defclass()

0 commit comments

Comments
 (0)