fix(godep): Fix NPE when Gopkg.lock contains zero projects. Fixes
@@ -48,7 +48,7 @@ public class GoLockParser {
public DependencyGraph parseDepLock(final InputStream depLockInputStream) {
final MutableDependencyGraph graph = new MutableMapDependencyGraph();
final GoLock goLock = new Toml().read(depLockInputStream).to(GoLock.class);
-
+ if (goLock.projects != null) {
for (final Project project : goLock.projects) {
if (project != null) {
final String projectName = project.name;
@@ -59,7 +59,7 @@ public class GoLockParser {
.forEach(graph::addChildToRoot);
}
}
-
+ }
return graph;
}
