fix(module: cascader): crashes when options is null (#563) (#2105)

This commit is contained in:
noctis0430 2021-11-12 12:14:29 +08:00 committed by GitHub
parent df2f75e76b
commit 75715f3f2b

View File

@ -54,7 +54,6 @@ namespace AntDesign
if (value?.Any() != true)
{
_nodelist = null;
return;
}
if (_nodelist == null) _nodelist = new List<CascaderNode>();
else if (_nodelist.Count != 0) _nodelist.Clear();
@ -64,7 +63,7 @@ namespace AntDesign
}
}
private List<CascaderNode> _nodelist;
private List<CascaderNode> _nodelist = new List<CascaderNode>();
private List<CascaderNode> _selectedNodes = new List<CascaderNode>();
private List<CascaderNode> _hoverSelectedNodes = new List<CascaderNode>();
private List<CascaderNode> _renderNodes = new List<CascaderNode>();