Fix null ref when expanding nodes from other providers (#1816)

* Fix null ref when expanding nodes from other providers

(cherry picked from commit 572a7b37b2a3651db5a101a8780c874c51b55b96)

* cleanup
This commit is contained in:
Charles Gagnon
2023-01-19 16:14:17 -08:00
committed by GitHub
parent 3f2d5da69a
commit ccaf5c4594
3 changed files with 19 additions and 12 deletions

View File

@@ -202,9 +202,9 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes
nodePath = path;
}
public TreeNode FindNodeByPath(string path, bool expandIfNeeded = false)
public TreeNode? FindNodeByPath(string path, bool expandIfNeeded = false)
{
TreeNode nodeForPath = ObjectExplorerUtils.FindNode(this, node =>
TreeNode? nodeForPath = ObjectExplorerUtils.FindNode(this, node =>
{
return node.GetNodePath() == path;
}, nodeToFilter =>