mirror of
https://github.com/zhigang1992/firebase-tools.git
synced 2026-01-12 09:04:01 +08:00
Fix issue 1069
This commit is contained in:
@@ -103,6 +103,10 @@ export class FirestoreIndexes {
|
||||
});
|
||||
|
||||
const indexes = res.body.indexes;
|
||||
if (!indexes) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return indexes.map(
|
||||
(index: any): API.Index => {
|
||||
// Ignore any fields that point at the document ID, as those are implied
|
||||
@@ -136,6 +140,12 @@ export class FirestoreIndexes {
|
||||
|
||||
const fields = res.body.fields as API.Field[];
|
||||
|
||||
// This should never be the case, since the API always returns the __default__
|
||||
// configuration, but this is a defensive check.
|
||||
if (!fields) {
|
||||
return [];
|
||||
}
|
||||
|
||||
// Ignore the default config, only list other fields.
|
||||
return fields.filter((field) => {
|
||||
return field.name.indexOf("__default__") < 0;
|
||||
|
||||
Reference in New Issue
Block a user