mirror of
https://github.com/usebruno/bruno.git
synced 2025-06-20 19:58:10 +02:00
Merge pull request #400 from lared/bug/env-with-empty-secret-variable
fix(#399): loading environment with empty secret variable fails
This commit is contained in:
commit
a204e3814b
@ -103,7 +103,7 @@ const addEnvironmentFile = async (win, pathname, collectionUid, collectionPath)
|
|||||||
const envSecrets = environmentSecretsStore.getEnvSecrets(collectionPath, file.data);
|
const envSecrets = environmentSecretsStore.getEnvSecrets(collectionPath, file.data);
|
||||||
_.each(envSecrets, (secret) => {
|
_.each(envSecrets, (secret) => {
|
||||||
const variable = _.find(file.data.variables, (v) => v.name === secret.name);
|
const variable = _.find(file.data.variables, (v) => v.name === secret.name);
|
||||||
if (variable) {
|
if (variable && secret.value) {
|
||||||
variable.value = decryptString(secret.value);
|
variable.value = decryptString(secret.value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -137,7 +137,7 @@ const changeEnvironmentFile = async (win, pathname, collectionUid, collectionPat
|
|||||||
const envSecrets = environmentSecretsStore.getEnvSecrets(collectionPath, file.data);
|
const envSecrets = environmentSecretsStore.getEnvSecrets(collectionPath, file.data);
|
||||||
_.each(envSecrets, (secret) => {
|
_.each(envSecrets, (secret) => {
|
||||||
const variable = _.find(file.data.variables, (v) => v.name === secret.name);
|
const variable = _.find(file.data.variables, (v) => v.name === secret.name);
|
||||||
if (variable) {
|
if (variable && secret.value) {
|
||||||
variable.value = decryptString(secret.value);
|
variable.value = decryptString(secret.value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user