Skip to content

Commit 32aa3ff

Browse files
Merge pull request #391 from N1ebieski:Fix-SyntaxError-Unexpected-end-of-JSON-input-#41
Fix SyntaxError: Unexpected end of JSON input
2 parents 821442f + f693db0 commit 32aa3ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/support/parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export const detect = async (
147147

148148
const promise = runCommand(`detect "${cleanArg(code)}"`)
149149
.then((result: string) => {
150-
return JSON.parse(result);
150+
return result.length > 0 ? JSON.parse(result) : result;
151151
})
152152
.catch((err) => {
153153
showErrorPopup(err);

0 commit comments

Comments
 (0)