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)