【修复】修复excel中多层标题头读取可空bean时抛异常的bug

main
walon 2021-12-02 17:11:49 +08:00
parent edc09b6742
commit 91bb1b317f
2 changed files with 3 additions and 3 deletions

View File

@ -351,8 +351,8 @@ namespace Luban.Job.Cfg.DataCreators
{ {
if (type.IsNullable) if (type.IsNullable)
{ {
string subType = row.GetSubTitleNamedRow(DefBean.TYPE_NAME_KEY).Current.ToString().Trim(); string subType = row.GetSubTitleNamedRow(DefBean.TYPE_NAME_KEY).Current?.ToString()?.Trim();
if (subType == DefBean.BEAN_NULL_STR) if (subType == null || subType == DefBean.BEAN_NULL_STR)
{ {
return null; return null;
} }

View File

@ -770,7 +770,7 @@ namespace Luban.Job.Cfg.Defs
return f; return f;
} }
private static readonly List<string> _beanOptinsAttrs = new List<string> { "value_type", "alias", "sep", "comment", "tags", "group", "externaltype" }; private static readonly List<string> _beanOptinsAttrs = new List<string> { "value_type", "alias", "sep", "comment", "tags", "externaltype" };
private static readonly List<string> _beanRequireAttrs = new List<string> { "name" }; private static readonly List<string> _beanRequireAttrs = new List<string> { "name" };
override protected void AddBean(string defineFile, XElement e, string parent) override protected void AddBean(string defineFile, XElement e, string parent)