mirror of
https://github.com/zhigang1992/firebase-tools.git
synced 2026-05-28 23:30:54 +08:00
Re-fix issue 495
This commit is contained in:
@@ -0,0 +1 @@
|
||||
fixed - Firestore Indexes deploy no longer crashes on an empty spec.
|
||||
@@ -453,8 +453,8 @@ export class FirestoreIndexes {
|
||||
fieldOverrides: spec.fieldOverrides || [],
|
||||
};
|
||||
|
||||
if (!spec.indexes) {
|
||||
return;
|
||||
if (!(spec.indexes && spec.indexes.length > 0)) {
|
||||
return result;
|
||||
}
|
||||
|
||||
// Try to detect use of the old API, warn the users.
|
||||
|
||||
@@ -40,6 +40,14 @@ describe("IndexValidation", () => {
|
||||
expect(upgraded).to.eql(VALID_SPEC);
|
||||
});
|
||||
|
||||
it("should accept an empty spec", () => {
|
||||
const empty = {
|
||||
indexes: [],
|
||||
};
|
||||
|
||||
idx.validateSpec(idx.upgradeOldSpec(empty));
|
||||
});
|
||||
|
||||
it("should accept a valid v1beta1 index spec after upgrade", () => {
|
||||
idx.validateSpec(
|
||||
idx.upgradeOldSpec({
|
||||
|
||||
Reference in New Issue
Block a user