diff --git a/dist/lib/logged.js b/dist/lib/logged.js index 0ebaec4..26419ae 100644 --- a/dist/lib/logged.js +++ b/dist/lib/logged.js @@ -98,7 +98,7 @@ function overrideBuild(originalFunction, baseLogger, metadatas, key, returnsData try { const r = originalFunction.call(this, ...args); if (originalFunction.constructor.name === 'AsyncFunction' || - (typeof r === 'object' && typeof r['then'] === 'function')) { + (r && typeof r === 'object' && typeof r['then'] === 'function')) { return r['then']((r) => { const resultLogged = Array.isArray(returnsData) ? typeof r === "object"