From 0ceaa93741bd8e8c82dffb7a53e9798b01faf827 Mon Sep 17 00:00:00 2001 From: p-sw Date: Wed, 10 Jan 2024 02:12:16 +0900 Subject: [PATCH] fix: r null checking --- dist/lib/logged.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"