π₯ π₯ π₯ A Free & Self-hostable Airtable Alternative
TypeScript airtableairtable-alternativeautomatic-apihacktoberfestlow-codeno-codeno-code-databaseno-code-platformpostgresqlrest-apirestful-apispreadsheetsqliteswagger
treat as empty value when json is malformed
Fendy Heryanto018bdf0d9f73
diff --git a/packages/nocodb/src/db/field-handler/handlers/attachment/attachment.general.handler.ts b/packages/nocodb/src/db/field-handler/handlers/attachment/attachment.general.handler.tsindex 8688243a54..40f7b58574 100644--- a/packages/nocodb/src/db/field-handler/handlers/attachment/attachment.general.handler.ts+++ b/packages/nocodb/src/db/field-handler/handlers/attachment/attachment.general.handler.ts@@ -41,14 +41,21 @@ export class AttachmentGeneralHandler extends ComputedFieldHandler {if (typeof value === 'string') {value = JSON.parse(value);} else if (!Array.isArray(value)) {- throwError();+ // do not throw error, but set it as empty array+ value = [];}+ } catch (e) {+ // do not throw error, but set it as empty array+ value = [];+ }+ try {if (typeof oldValue === 'string') {oldValue = JSON.parse(oldValue);}oldValueMap = new Map(oldValue.map((val) => [val.id, val]));} catch (e) {- throwError();+ // do not throw error, but set it as empty map+ oldValueMap = new Map();}let tempIndex = 1;