Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix: handle undefined variable values

Daniel Hougaard19776df46ca4
diff --git a/backend/src/services/external-migration/external-migration-fns.ts b/backend/src/services/external-migration/external-migration-fns.ts
index 0e3cc576f2..3af44c368c 100644
--- a/backend/src/services/external-migration/external-migration-fns.ts
+++ b/backend/src/services/external-migration/external-migration-fns.ts
@@ -187,7 +187,7 @@ export const importDataIntoInfisicalFn = async ({
secretPath: "/",
secretName: secret.name,
type: SecretType.Shared,
- secretValue: secret.value
+ secretValue: secret.value || ""
});
if (!newSecret) {
throw new BadRequestError({ message: `Failed to import secret: [name:${secret.name}] [id:${id}]` });
diff --git a/backend/src/services/external-migration/external-migration-types.ts b/backend/src/services/external-migration/external-migration-types.ts
index cb58ad9a25..4139b0cf53 100644
--- a/backend/src/services/external-migration/external-migration-types.ts
+++ b/backend/src/services/external-migration/external-migration-types.ts
@@ -18,7 +18,7 @@ export type InfisicalImportData = {
name: string;
id: string;
environmentId: string;
- value: string;
+ value?: string;
}
>;
};