From ae10b66c87391c1a95e1bd5552d105d37dec642f Mon Sep 17 00:00:00 2001 From: Alan Hamlett Date: Thu, 5 Dec 2024 14:00:21 +0100 Subject: [PATCH] Prevent trying to parse newline string as json --- src/wakatime.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wakatime.ts b/src/wakatime.ts index d6a8d18..5542a48 100644 --- a/src/wakatime.ts +++ b/src/wakatime.ts @@ -831,7 +831,7 @@ export class WakaTime { } proc.on('close', (code, _signal) => { if (code == 0) { - if (output) { + if (output && output.trim()) { let jsonData; try { jsonData = JSON.parse(output);