diff --git a/插件库/Lskj.PubBomImport/FrmProgress.cs b/插件库/Lskj.PubBomImport/FrmProgress.cs index f47b718..84c15d4 100644 --- a/插件库/Lskj.PubBomImport/FrmProgress.cs +++ b/插件库/Lskj.PubBomImport/FrmProgress.cs @@ -622,8 +622,12 @@ namespace Lskj.PubBomImport insertbulider.AppendLine($"insert into FileAttachmentMapping (MaterialCode,MxFileName,RelatedAttachmentName,OperatorUser,ChangeStatus) values ('{topProductId}','{sourceCode }','{childCode}','{ERPInfo.Instance.UserName}','变更');"); if (childCode.StartsWith("QD") || childCode.StartsWith("ZZQD")) { - string tempFileName = childFileDic[childCode]; - FileInfo childInfo = new FileInfo(tempFileName); + string tempFileName = childFileDic.ContainsKey(childCode) ? childFileDic[childCode] : ""; + FileInfo childInfo = null; + if (!string.IsNullOrEmpty(tempFileName)) + { + childInfo = new FileInfo(tempFileName); + } if (childInfo == null) { //throw new Exception($"MX明细中不包含文件{childCode}");