🐛 fix(parameterComponent): fix nullish coalescing operator usage to prevent potential error when accessing nested object properties

This commit is contained in:
Cristhian Zanforlin Lousa 2023-09-15 08:48:23 -03:00
commit a6751d4a17

View file

@ -383,7 +383,10 @@ export default function ParameterComponent({
<KeypairListComponent <KeypairListComponent
disabled={disabled} disabled={disabled}
editNode={false} editNode={false}
value={data.node!.template[name].value ?? convertObjToArray(dict)} value={
convertObjToArray(data.node!.template[name].value) ??
convertObjToArray(dict)
}
duplicateKey={errorDuplicateKey} duplicateKey={errorDuplicateKey}
onChange={(newValue: string[]) => { onChange={(newValue: string[]) => {
setErrorDuplicateKey(hasDuplicateKeys(newValue)); setErrorDuplicateKey(hasDuplicateKeys(newValue));