Skip to content

Commit

Permalink
Validate that batch passed to Catalog.upsertDocuments is not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
chaosrealm committed Jul 9, 2024
1 parent d1b070b commit 282ac08
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions catalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ export class Catalog {
}

public async upsertDocuments(batch: DocumentBatch) {
if (batch.length === 0) {
throw new Error("Document batch must not be empty");
}

this.checkDeleted();
let hasText = false;
let hasFile = false;
Expand Down

0 comments on commit 282ac08

Please sign in to comment.