Skip to content

Commit

Permalink
Add error if the note is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
giade committed Oct 3, 2023
1 parent 74247bb commit e1ded0c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jumpgroup/secret-fetcher",
"version": "1.6.0",
"version": "1.6.1",
"author": "JumpGroup srl",
"main": "src/index.js",
"license": "MIT",
Expand Down
4 changes: 4 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,10 @@ export const updateNoteSecret = async (options) => {
console.log("Get note of secret from Passwd");
const noteOfSecret = await getSecrets(options);

if (noteOfSecret.length == 0) {
throw new Error("Secret not found");
}

//object to string
const noteOfSecretString = JSON.stringify(noteOfSecret[options.name]);

Expand Down

0 comments on commit e1ded0c

Please sign in to comment.