From c0c6eb3b654b3d0a0fd344db93907aba290b446f Mon Sep 17 00:00:00 2001 From: Aviv Turgeman Date: Mon, 27 May 2024 15:46:23 +0300 Subject: [PATCH] CNV-41589: Error "Cannot read properties of undefined (reading "push")" on creation of a VM with Sysprep Signed-off-by: Aviv Turgeman --- src/utils/components/SysprepModal/sysprep-utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/components/SysprepModal/sysprep-utils.ts b/src/utils/components/SysprepModal/sysprep-utils.ts index 3ea254734..82bc96efd 100644 --- a/src/utils/components/SysprepModal/sysprep-utils.ts +++ b/src/utils/components/SysprepModal/sysprep-utils.ts @@ -28,7 +28,7 @@ export const addSysprepConfig = (vm: V1VirtualMachine, newSysprepName: string) = configMap: { name: newSysprepName }, }, }); - getDisks(vm).push(sysprepDisk()); + (getDisks(vm) || []).push(sysprepDisk()); }; export const removeSysprepConfig = (vm: V1VirtualMachine, sysprepVolumeName: string) => {