Skip to content

Commit 9998d8e

Browse files
chore: extra guard to avoid having same name export
1 parent 2b2d615 commit 9998d8e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/common/exportsManager.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ export class ExportsManager extends EventEmitter<ExportsManagerEvents> {
158158
}): AvailableExport {
159159
try {
160160
const exportNameWithExtension = validateExportName(ensureExtension(exportName, "json"));
161+
if (this.storedExports[exportNameWithExtension]) {
162+
throw new Error("Export with same name is either already available or being generated.");
163+
}
161164
const exportURI = `exported-data://${encodeURIComponent(exportNameWithExtension)}`;
162165
const exportFilePath = path.join(this.exportsDirectoryPath, exportNameWithExtension);
163166
const inProgressExport: InProgressExport = (this.storedExports[exportNameWithExtension] = {

0 commit comments

Comments
 (0)