diff --git a/src/settings/ReadingRoomAccess/getFieldComponents.js b/src/settings/ReadingRoomAccess/getFieldComponents.js index 5535b7f..584a30b 100644 --- a/src/settings/ReadingRoomAccess/getFieldComponents.js +++ b/src/settings/ReadingRoomAccess/getFieldComponents.js @@ -30,7 +30,7 @@ export const getFieldComponents = (fieldLabels, options, rraData) => ({ {...fieldProps} aria-label={`${fieldLabels[name]} ${rowIndex}`} component={Checkbox} - initialValue={rraData[rowIndex].isPublic} + initialValue={rraData[rowIndex]?.isPublic ?? false} type="checkbox" marginBottom0 /> diff --git a/src/settings/ReadingRoomAccess/getValidators.js b/src/settings/ReadingRoomAccess/getValidators.js index 5f8f091..45cd8f9 100644 --- a/src/settings/ReadingRoomAccess/getValidators.js +++ b/src/settings/ReadingRoomAccess/getValidators.js @@ -13,7 +13,7 @@ const validators = { }, [readingRoomAccessColumns.SERVICEPOINTS]: (item) => { const { servicePoints } = item; - if (!servicePoints) { + if (!servicePoints?.length) { return ; } return undefined;