fix dereferenced null variable

This commit is contained in:
pointfeev 2022-06-10 21:13:06 -05:00
parent c1305c3712
commit 6ca07b02de

View file

@ -23,8 +23,8 @@ internal class CustomTreeView : TreeView
public int Compare(object a, object b)
{
TreeNode NodeA = a as TreeNode;
TreeNode NodeB = b as TreeNode;
if (a is not TreeNode NodeA) return 0;
if (b is not TreeNode NodeB) return 0;
string StringA = compareText ? NodeA.Text : NodeA.Name;
string StringB = compareText ? NodeB.Text : NodeB.Name;
return AppIdComparer.Comparer.Compare(StringA, StringB);