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 MaltonandSebastian Malton authored and Lauri Nevala committed 2020-06-24 09:18:28 +03:00
1 parent 29d6b0b989
commit bd58456a10
1 file changed
+4 -3
@@ -120,7 +120,10 @@ const SecretKey = (props: SecretKeyProps) => {
setSecret(secret)
}
if (!secret) {
if (secret?.data?.[key]) {
return <>{base64.decode(secret.data[key])}</>
}
return (
<>
secretKeyRef({name}.{key})&nbsp;
@@ -132,6 +135,4 @@ const SecretKey = (props: SecretKeyProps) => {
/>
</>
)
}
return <>{base64.decode(secret.data[key])}</>
}