Skip to content

Commit

Permalink
make sure that secret is defined before trying to decode (#479)
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Malton <smalton@mirantis.com>

Co-authored-by: Sebastian Malton <smalton@mirantis.com>
  • Loading branch information
2 people authored and nevalla committed Jun 24, 2020
1 parent 29d6b0b commit bd58456
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,11 @@ const SecretKey = (props: SecretKeyProps) => {
setSecret(secret)
}

if (!secret) {
return (
if (secret?.data?.[key]) {
return <>{base64.decode(secret.data[key])}</>
}

return (
<>
secretKeyRef({name}.{key})&nbsp;
<Icon
Expand All @@ -131,7 +134,5 @@ const SecretKey = (props: SecretKeyProps) => {
onClick={showKey}
/>
</>
)
}
return <>{base64.decode(secret.data[key])}</>
}
)
}

0 comments on commit bd58456

Please # to comment.