Skip to content

Commit

Permalink
Prevent trying to parse newline string as json
Browse files Browse the repository at this point in the history
  • Loading branch information
alanhamlett committed Dec 5, 2024
1 parent fba282e commit ae10b66
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wakatime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ae10b66

Please sign in to comment.