diff --git a/src/debug.ts b/src/debug.ts index 494f1aa..e5fc05b 100644 --- a/src/debug.ts +++ b/src/debug.ts @@ -188,7 +188,7 @@ export function curryLog(initialText: string, level: LogLevel = "log") { if (debugging) { const timestamp = new Date().toISOString(); const stack = new Error().stack; - const callerInfo = stack ? stack.split("\n")[2].trim() : ""; + const callerInfo = stack?.split("\n")[2]?.trim() ?? ""; const serializedArgs = args.map(serializeArg).join(" "); const logEntry: LogEntry = {