From e27042db999aa654702f22364a80657ed00616c9 Mon Sep 17 00:00:00 2001 From: Christian Banse Date: Thu, 2 Sep 2021 14:43:39 +0200 Subject: [PATCH] Fixed potential null pointer in TypeResolver (#552) --- .../main/java/de/fraunhofer/aisec/cpg/passes/TypeResolver.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpg-library/src/main/java/de/fraunhofer/aisec/cpg/passes/TypeResolver.java b/cpg-library/src/main/java/de/fraunhofer/aisec/cpg/passes/TypeResolver.java index ffa395e3ca..9a7f161688 100644 --- a/cpg-library/src/main/java/de/fraunhofer/aisec/cpg/passes/TypeResolver.java +++ b/cpg-library/src/main/java/de/fraunhofer/aisec/cpg/passes/TypeResolver.java @@ -248,7 +248,7 @@ public void ensureUniqueType(Node node) { types = typeState.keySet(); } else { Type root = oldType.getRoot(); - types = typeState.get(root); + types = typeState.computeIfAbsent(root, x -> new ArrayList<>()); } updateType(node, types);