diff --git a/src/core/carstore/repo/datastore/index.ts b/src/core/carstore/repo/datastore/index.ts index 41b2945..2f3b962 100644 --- a/src/core/carstore/repo/datastore/index.ts +++ b/src/core/carstore/repo/datastore/index.ts @@ -149,6 +149,16 @@ export class CarMongoDatastore extends DataStore< if (!car.ok) { return { ok: false, error: car.error } } + + if ( + !car.data || + car.data.length == 0 || + !car.data[0].replicaInfos + ) { + console.log("find car replica failed") + return { ok: true } + } + if (options.replicaIndex >= car.data![0].replicaInfos!.length) { return { ok: false,