diff --git a/src/utils/file.ts b/src/utils/file.ts index 0886c98b..16455f67 100644 --- a/src/utils/file.ts +++ b/src/utils/file.ts @@ -588,8 +588,8 @@ export const isJSONFun = (str: any) => { // 删除无用附件文件 export const removeAttachmentFileIds = (oldIds: string, newIds: any) => { - const oldList = oldIds.split(','); - const newList = newIds.split(','); + const oldList = oldIds?.split(',') || []; + const newList = newIds?.split(',') || []; const newSet = new Set(newList); const delIds: any[] = oldList.filter((id) => !newSet.has(id)); delIds.forEach((id: any) => {