Skip to content

Commit

Permalink
Safer NewDependency node creation
Browse files Browse the repository at this point in the history
String values from the JS AST constructed by the graalvm js parser may be null for accessors like getName etc.

This is for: ShiftLeftSecurity/product#8437
  • Loading branch information
max-leuthaeuser committed Sep 1, 2021
1 parent 02c8874 commit fc4fc0d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ class AstNodeBuilder[NodeBuilderType](private val diffGraph: DiffGraph.Builder,

def createDependencyNode(name: String, groupId: String, version: String): NewDependency = {
val dependency = NewDependency()
.version(version)
.name(name)
.dependencyGroupId(Some(groupId))
.name(Option(name).getOrElse("<n/a>"))
.dependencyGroupId(Option(groupId).getOrElse("<n/a>"))
.version(Option(version).getOrElse("<n/a>"))
.build
diffGraph.addNode(dependency)
dependency
Expand Down

0 comments on commit fc4fc0d

Please sign in to comment.