From 938482d450f551a70b3ae60c0fcd54f57049e59a Mon Sep 17 00:00:00 2001 From: Murphy Date: Fri, 24 Feb 2023 15:18:53 +0100 Subject: [PATCH] Fix undefined return value when tracing with format and the return value is 0x0 --- src/agent/lib/debug/trace.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/agent/lib/debug/trace.ts b/src/agent/lib/debug/trace.ts index ca7cc710..ed68130f 100644 --- a/src/agent/lib/debug/trace.ts +++ b/src/agent/lib/debug/trace.ts @@ -477,16 +477,16 @@ function _cloneArgs(args: string[], fmt: string) { return a; } -function _formatRetval(retval: any, fmt: any) { - if (retval !== undefined && !retval.isNull()) { +function _formatRetval(retval: any, fmt: string) { + if (fmt !== undefined) { const retToken = fmt.indexOf('%'); if (retToken !== -1 && fmt[retToken + 1] !== undefined) { try { return _format(retval, fmt[retToken + 1]); } catch (e: any) { } } - return retval; } + return retval; } function _formatArgs(args: string[], fmt: string) {