Skip to content

Commit

Permalink
Merge pull request #1389 from akto-api-security/hotfix/dep_flow_null_…
Browse files Browse the repository at this point in the history
…connections

fixed null pointer
  • Loading branch information
avneesh-akto authored Aug 22, 2024
2 parents e1a9b9c + 5e7c40c commit aba92bb
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ public void parseTree() {
}

Node nodeFromQueue = resultNodes.get(apiInfoKey);
if (nodeFromQueue == null) continue;
nodeFromQueue.fillMaxDepth();
int depth = nodeFromQueue.getMaxDepth();

Expand Down Expand Up @@ -237,7 +238,9 @@ public ApiInfo.ApiInfoKey markNodeAsDone() {
ApiInfo.ApiInfoKey childApi = new ApiInfo.ApiInfoKey(Integer.parseInt(reverseEdge.getApiCollectionId()), reverseEdge.getUrl(), URLMethods.Method.fromString(reverseEdge.getMethod()));

Node resultNode = resultNodes.get(childApi);
if (resultNode == null) continue;
Map<String, Connection> connections = resultNode.getConnections();
if (connections == null) continue;

String param = reverseEdge.getParam();
if (reverseEdge.getIsHeader()) {
Expand Down Expand Up @@ -270,6 +273,7 @@ public ApiInfo.ApiInfoKey markNodeAsDone() {
ApiInfo.ApiInfoKey apiInfoKey = generateApiInfoKeyFromString(apiInfoKeyString);

Node node = resultNodes.get(apiInfoKey);
if (node == null) continue;
Map<String, Connection> connections = node.getConnections();
int missing = 0;
int filled = 0;
Expand All @@ -289,7 +293,7 @@ public ApiInfo.ApiInfoKey markNodeAsDone() {
if (missing < currentMinMissingCount) result = apiInfoKey;
}

if (result != null) {
if (result != null && resultNodes.get(result) != null) {
logger.info(resultNodes.get(result).getUrl() + " is being marked done");
}

Expand Down

0 comments on commit aba92bb

Please sign in to comment.