mirror of
https://github.com/github/codeql.git
synced 2026-05-02 12:15:17 +02:00
JS: Do not crash on empty package.json file
This commit is contained in:
@@ -746,6 +746,9 @@ protected DependencyInstallationResult preparePackagesAndDependencies(Set<Path>
|
||||
if (file.getFileName().toString().equals("package.json")) {
|
||||
try {
|
||||
PackageJson packageJson = new Gson().fromJson(new WholeIO().read(file), PackageJson.class);
|
||||
if (packageJson == null) {
|
||||
continue;
|
||||
}
|
||||
file = file.toAbsolutePath();
|
||||
if (tryRelativize(sourceRoot, file) == null) {
|
||||
continue; // Ignore package.json files outside the source root.
|
||||
|
||||
Reference in New Issue
Block a user