Skip to content

Commit

Permalink
NP Exception fix (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
prathamgahlout authored Mar 8, 2024
1 parent a6dbeb4 commit 4a91790
Showing 1 changed file with 16 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,22 @@ public ArrayList<Module> readModules() {
Toml dependencies = toml.getTable("dependencies");

Module root = new Module(moduleTitle, version);

dependencies.entrySet()
.stream()
.forEach(
dep -> {
String name = dep.getKey();
String ver = dep.getValue().toString();

// Resolve version before proceeding
String resolvedVersion = CargoVersionHelper.resolveVersion(ver);
Module module = new Module(name,resolvedVersion);
resolveDependencyTree(module);
root.addToDependencies(module);
}
);
if(dependencies != null) {
dependencies.entrySet()
.stream()
.forEach(
dep -> {
String name = dep.getKey();
String ver = dep.getValue().toString();

// Resolve version before proceeding
String resolvedVersion = CargoVersionHelper.resolveVersion(ver);
Module module = new Module(name,resolvedVersion);
resolveDependencyTree(module);
root.addToDependencies(module);
}
);
}
modules.add(root);

return modules;
Expand Down

0 comments on commit 4a91790

Please sign in to comment.