Compare commits

...
Author SHA1 Message Date
Sonarly Claude CodeandClaude Opus 4.6 0e081fe590 Fix TypeError when fieldMetadataItem is undefined in RecordTableCellFieldContextWrapper
Add null guard for fieldMetadataItem lookup from fieldMetadataItemByFieldMetadataItemId
map. When a recordField's fieldMetadataItemId doesn't exist in the map (e.g. during
navigation away from a record table view), the lookup returns undefined and accessing
.name on it throws "Cannot read properties of undefined (reading 'name')".

Sentry issue: https://sentry.io/issues/6918487847/

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 03:25:43 +00:00
@@ -27,6 +27,10 @@ export const RecordTableCellFieldContextWrapper = ({
const fieldMetadataItem =
fieldMetadataItemByFieldMetadataItemId[recordField.fieldMetadataItemId];
if (!fieldMetadataItem) {
return null;
}
const instanceId = getRecordFieldInputInstanceId({
recordId,
fieldName: fieldMetadataItem.name,