!2830 fix(#I59H9S): throw null reference exception cause by ColumnVisibles is null

* refactor: 更新代码
* chore: bump version 6.6.18
* revert: 恢复代码
This commit is contained in:
Argo 2022-05-28 02:24:40 +00:00
parent 22a4216416
commit c1036a4114
2 changed files with 8 additions and 3 deletions

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<Version>6.6.17</Version>
<Version>6.6.18</Version>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">

View File

@ -230,8 +230,13 @@ public partial class Table<TItem>
private IEnumerable<ITableColumn> GetColumns()
{
// https://gitee.com/LongbowEnterprise/BootstrapBlazor/issues/I2LBM8
var items = ColumnVisibles.Where(i => i.Visible);
return Columns.Where(i => items.Any(v => v.FieldName == i.GetFieldName()));
IEnumerable<ITableColumn> cols = Columns;
if (ColumnVisibles != null)
{
var items = ColumnVisibles.Where(i => i.Visible);
cols = Columns.Where(i => items.Any(v => v.FieldName == i.GetFieldName()));
}
return cols;
}
private bool GetColumnsListState(ITableColumn col)