1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

make sure that secret is defined before trying to decode (#479)

Signed-off-by: Sebastian Malton <smalton@mirantis.com>

Co-authored-by: Sebastian Malton <smalton@mirantis.com>
This commit is contained in:
Sebastian Malton 2020-06-16 13:46:02 -04:00 committed by GitHub
parent d48b463ea7
commit b9ddb503ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
@ -131,7 +134,5 @@ const SecretKey = (props: SecretKeyProps) => {
onClick={showKey}
/>
</>
)
}
return <>{base64.decode(secret.data[key])}</>
}
)
}