Skip to content

Commit f693db0

Browse files
committed
Fix SyntaxError: Unexpected end of JSON input
Fixes N1ebieski#41
1 parent 821442f commit f693db0

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)