mirror of
https://gitee.com/dotnetchina/MiniExcel.git
synced 2024-11-29 18:38:08 +08:00
Fix propInfo.Key missing
This commit is contained in:
parent
3d63587d9c
commit
6151c3f335
BIN
samples/xlsx/TestIssue24020201.xlsx
Normal file
BIN
samples/xlsx/TestIssue24020201.xlsx
Normal file
Binary file not shown.
@ -475,7 +475,8 @@ namespace MiniExcelLibs.OpenXml
|
|||||||
rowXml.Replace(key, "");
|
rowXml.Replace(key, "");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (!dic.ContainsKey(propInfo.Key))
|
||||||
|
continue;
|
||||||
var cellValue = dic[propInfo.Key];
|
var cellValue = dic[propInfo.Key];
|
||||||
if (cellValue == null)
|
if (cellValue == null)
|
||||||
{
|
{
|
||||||
@ -985,12 +986,15 @@ namespace MiniExcelLibs.OpenXml
|
|||||||
v.InnerText = v.InnerText.Replace($"{{{{{propNames[0]}}}}}", propNames[1]);
|
v.InnerText = v.InnerText.Replace($"{{{{{propNames[0]}}}}}", propNames[1]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (!xRowInfo.PropsMap.ContainsKey(propNames[1]))
|
||||||
|
{
|
||||||
|
v.InnerText = v.InnerText.Replace($"{{{{{propNames[0]}.{propNames[1]}}}}}", "");
|
||||||
|
continue;
|
||||||
|
throw new InvalidDataException($"{propNames[0]} doesn't have {propNames[1]} property");
|
||||||
|
}
|
||||||
// auto check type https://github.com/shps951023/MiniExcel/issues/177
|
// auto check type https://github.com/shps951023/MiniExcel/issues/177
|
||||||
var prop = xRowInfo.PropsMap[propNames[1]];
|
var prop = xRowInfo.PropsMap[propNames[1]];
|
||||||
var type = prop.UnderlyingTypePropType; //avoid nullable
|
var type = prop.UnderlyingTypePropType; //avoid nullable
|
||||||
//
|
|
||||||
if (!xRowInfo.PropsMap.ContainsKey(propNames[1]))
|
|
||||||
throw new InvalidDataException($"{propNames[0]} doesn't have {propNames[1]} property");
|
|
||||||
|
|
||||||
if (isMultiMatch)
|
if (isMultiMatch)
|
||||||
{
|
{
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user