Skip to content

Commit 5e83741

Browse files
oxistomaximiliankaul
authored andcommitted
implicit() only triggers code/location update now if its not empty (#1784)
Otherwise, we override the code/location again.
1 parent b358fa1 commit 5e83741

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/NodeBuilder.kt

+6-2
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,12 @@ interface RawNodeTypeProvider<T> : MetadataProvider
256256
* This also sets [Node.isImplicit] to true.
257257
*/
258258
fun <T : Node> T.implicit(code: String? = null, location: PhysicalLocation? = null): T {
259-
this.code = code
260-
this.location = location
259+
if (code != null) {
260+
this.code = code
261+
}
262+
if (location != null) {
263+
this.location = location
264+
}
261265
this.isImplicit = true
262266

263267
return this

0 commit comments

Comments
 (0)