diff options
Diffstat (limited to 'util/serialization.lua')
-rw-r--r-- | util/serialization.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/util/serialization.lua b/util/serialization.lua index 60e341cf..d70e92ba 100644 --- a/util/serialization.lua +++ b/util/serialization.lua @@ -267,10 +267,15 @@ local function deserialize(str) return ret; end +local default = new(); return { new = new; serialize = function (x, opt) - return new(opt)(x); + if opt == nil then + return default(x); + else + return new(opt)(x); + end end; deserialize = deserialize; }; |