diff --git a/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/NodeBuilder.kt b/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/NodeBuilder.kt index cf7e12e01e..ffa70363df 100644 --- a/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/NodeBuilder.kt +++ b/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/NodeBuilder.kt @@ -256,8 +256,12 @@ interface RawNodeTypeProvider : MetadataProvider * This also sets [Node.isImplicit] to true. */ fun T.implicit(code: String? = null, location: PhysicalLocation? = null): T { - this.code = code - this.location = location + if (code != null) { + this.code = code + } + if (location != null) { + this.location = location + } this.isImplicit = true return this