Skip to content

Commit

Permalink
Merge pull request #228 from Checkmarx/fix/elchanan/handle-null-check…
Browse files Browse the repository at this point in the history
…-convert-results

Add null check to handle null Result (AST-77727)
  • Loading branch information
elchananarb authored Dec 22, 2024
2 parents 3215cc3 + 9bb1df9 commit 0e5d3a3
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ private TreeViewItem BuildTree()
// Convert AST results to tree view item
private List<TreeViewItem> ConvertResultsToTreeViewItem(Results results)
{

// Check if results or results.results is null and return an empty list if so
if (results?.results == null)
{
return new List<TreeViewItem>();
}
List<Result> allResults = results.results;
List<TreeViewItem> transformedResults = new List<TreeViewItem>(allResults.Count);

Expand Down

0 comments on commit 0e5d3a3

Please sign in to comment.