diff --git a/imports/callback/client.lua b/imports/callback/client.lua index e47a3ccc3..b24a4ec9f 100644 --- a/imports/callback/client.lua +++ b/imports/callback/client.lua @@ -50,7 +50,9 @@ local function triggerServerCallback(_, event, delay, cb, ...) return promise:resolve(response and { msgpack.unpack(response) } or {}) end - return cb and cb(response and msgpack.unpack(response)) + if cb and response then + cb(msgpack.unpack(response)) + end end if promise then diff --git a/imports/callback/server.lua b/imports/callback/server.lua index 184dd31dd..d8e85ddca 100644 --- a/imports/callback/server.lua +++ b/imports/callback/server.lua @@ -31,7 +31,9 @@ local function triggerClientCallback(_, event, playerId, cb, ...) return promise:resolve(response and { msgpack.unpack(response) } or {}) end - return cb and cb(response and msgpack.unpack(response)) + if cb and response then + cb(msgpack.unpack(response)) + end end if promise then