Skip to content

Sync-in · Sovereign platform for file storage, sharing, synchronization, and collaboration.

fix(backend:files): handle optional chaining in indexing key generation

johaven2b2c2385f64e
diff --git a/backend/src/applications/files/utils/indexing.ts b/backend/src/applications/files/utils/indexing.ts
index 3d0a96f2..f8a10a08 100644
--- a/backend/src/applications/files/utils/indexing.ts
+++ b/backend/src/applications/files/utils/indexing.ts
@@ -12,7 +12,7 @@ export function indexingUpdateCacheKeysFromSpace(userId: number, space: SpaceEnv
if (space.inSharesRepository && !space.root.externalPath) {
// shares that are linked to a space must also be indexed
cacheKeys.push(`${CACHE_INDEXING_UPDATE_PREFIX}-${genIndexingKey(space.id, FILE_REPOSITORY.SHARE, '-')}`)
- } else if (space.inFilesRepository && space.root.owner?.login) {
+ } else if (space.inFilesRepository && space.root?.owner?.login) {
// space where the user’s root file is anchored
cacheKeys.push(`${CACHE_INDEXING_UPDATE_PREFIX}-${genIndexingKey(space.id, FILE_REPOSITORY.SPACE, '-')}`)
}