mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 17:48:56 +01:00
Fixes #127626: Add try/catch around JSON.parse
This commit is contained in:
@@ -177,7 +177,13 @@ async function readLockfileContents(logService: ILogService, filename: string):
|
||||
return null;
|
||||
}
|
||||
|
||||
return JSON.parse(String(contents));
|
||||
try {
|
||||
return JSON.parse(String(contents));
|
||||
} catch (err) {
|
||||
// cannot parse the file
|
||||
logService.error(err);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user