diff --git a/packages/app-form-builder/src/admin/views/cache.ts b/packages/app-form-builder/src/admin/views/cache.ts index ec8e8d230c..d54a62f418 100644 --- a/packages/app-form-builder/src/admin/views/cache.ts +++ b/packages/app-form-builder/src/admin/views/cache.ts @@ -29,6 +29,9 @@ export const updateLatestRevisionInListCache = ( } const index = formBuilder.listForms.data.findIndex(item => item.id.startsWith(uniqueId)); + if (index < 0) { + return; + } cache.writeQuery({ ...gqlParams, @@ -99,6 +102,9 @@ export const removeFormFromListCache = (cache: DataProxy, form: FbRevisionModel) } const index = formBuilder.listForms.data.findIndex(item => item.id === form.id); + if (index < 0) { + return; + } cache.writeQuery({ ...gqlParams,