From 05a2defb44b352fd3deb4bc9109e999b855fa60a Mon Sep 17 00:00:00 2001 From: p-sw Date: Wed, 10 Jan 2024 02:10:09 +0900 Subject: [PATCH] fix: r null checking --- src/logged.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/logged.ts b/src/logged.ts index 7723294..a2f37d2 100644 --- a/src/logged.ts +++ b/src/logged.ts @@ -178,7 +178,7 @@ function overrideBuild, R>( const r: 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: any) => { const resultLogged = Array.isArray(returnsData)