fix(callback): pack nil values

See #117
This commit is contained in:
Linden
2022-10-08 22:20:46 +11:00
parent 10dfa59bcd
commit b05594e77f
2 changed files with 6 additions and 6 deletions

View File

@@ -28,10 +28,10 @@ local function triggerClientCallback(_, event, playerId, cb, ...)
events[key] = nil
if promise then
return promise:resolve(response or {})
return promise:resolve(response and { msgpack.unpack(response) } or {})
end
return cb and cb(table.unpack(response or {}))
return cb and cb(msgpack.unpack(response))
end
if promise then
@@ -60,7 +60,7 @@ local function callbackResponse(success, result, ...)
return false
end
return { result, ... }
return msgpack.pack(result, ...)
end
local pcall = pcall