diff --git a/packages/realm-react/src/cachedCollection.ts b/packages/realm-react/src/cachedCollection.ts index 806be0071e..1f2ffedcb3 100644 --- a/packages/realm-react/src/cachedCollection.ts +++ b/packages/realm-react/src/cachedCollection.ts @@ -169,7 +169,7 @@ export function createCachedCollection>({ // Item(s) were modified, just clear them from the cache so that we return new instances for them changes.newModifications.forEach((index) => { - const objectId = listenerCollection[index]._objectKey(); + const objectId = listenerCollection[index]?._objectKey(); if (objectId) { const cacheKey = getCacheKey(objectId); if (objectCache.has(cacheKey)) {