[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

@ -16,14 +16,21 @@ namespace Luban.Job.Cfg.DataSources.Excel
{ {
get get
{ {
var v = Row[SelfTitle.FromIndex].Value; if (Row != null)
if (v == null || (v is string s && string.IsNullOrEmpty(s) && !string.IsNullOrEmpty(SelfTitle.Default)))
{ {
return SelfTitle.Default; var v = Row[SelfTitle.FromIndex].Value;
if (v == null || (v is string s && string.IsNullOrEmpty(s) && !string.IsNullOrEmpty(SelfTitle.Default)))
{
return SelfTitle.Default;
}
else
{
return v;
}
} }
else else
{ {
return v; throw new Exception($"简单数据类型字段 不支持子列名或者多行");
} }
} }
} }