Browse Source

fix: set attachment cell to null if wrong value provided

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/5847/head
mertmit 1 year ago
parent
commit
9c04bbcce9
  1. 5
      packages/nc-gui/composables/useMultiSelect/convertCellData.ts

5
packages/nc-gui/composables/useMultiSelect/convertCellData.ts

@ -80,10 +80,11 @@ export default function convertCellData(
parsedVal = parseProp(value)
parsedVal = Array.isArray(parsedVal) ? parsedVal : [parsedVal]
} catch (e) {
throw new Error('Invalid attachment data')
console.error('Invalid attachment value', e)
return null
}
if (parsedVal.some((v: any) => v && !(v.url || v.data || v.path))) {
throw new Error('Invalid attachment data')
return null
}
// TODO(refactor): duplicate logic in attachment/utils.ts
const defaultAttachmentMeta = {

Loading…
Cancel
Save