[opt] 优化错误为int之类的字段使用子列名时的报错信息

main
walon 2022-04-10 13:33:06 +08:00
parent f7814a0612
commit d9a2e0f83b
1 changed files with 11 additions and 4 deletions

View File

@ -15,6 +15,8 @@ namespace Luban.Job.Cfg.DataSources.Excel
public object Current
{
get
{
if (Row != null)
{
var v = Row[SelfTitle.FromIndex].Value;
if (v == null || (v is string s && string.IsNullOrEmpty(s) && !string.IsNullOrEmpty(SelfTitle.Default)))
@ -26,6 +28,11 @@ namespace Luban.Job.Cfg.DataSources.Excel
return v;
}
}
else
{
throw new Exception($"简单数据类型字段 不支持子列名或者多行");
}
}
}
public List<Cell> Row { get; }