Skip to content

Commit

Permalink
Add null check to ConvertResultsToTreeViewItem to handle null Results…
Browse files Browse the repository at this point in the history
… object
  • Loading branch information
elchananarb committed Dec 22, 2024
1 parent 3215cc3 commit 9bb1df9
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 9bb1df9

Please sign in to comment.