From 48d8b47cf93af7f87e7bc0464fa2cd0ecdcb8b64 Mon Sep 17 00:00:00 2001 From: Dmitry Filatov Date: Mon, 14 Aug 2023 15:34:52 +0300 Subject: [PATCH] fix: check param exists --- src/Traits/Soap/SoapImportApis.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Traits/Soap/SoapImportApis.php b/src/Traits/Soap/SoapImportApis.php index f659e78..128ec9f 100644 --- a/src/Traits/Soap/SoapImportApis.php +++ b/src/Traits/Soap/SoapImportApis.php @@ -166,7 +166,7 @@ public function importVApp(string $resourcePoolId, $entityConfig, $instantiation 'virtualICH7MPresent' => $configSpec->virtualICH7MPresent ?? null, 'virtualSMCPresent' => $configSpec->virtualSMCPresent ?? null, 'deviceChange' => $deviceChange, - 'memoryAllocation' => [ + 'memoryAllocation' => isset($configSpec->memoryAllocation) ? [ 'reservation' => $configSpec->memoryAllocation->reservation ?? null, 'expandableReservation' => $configSpec->memoryAllocation->expandableReservation ?? null, 'limit' => $configSpec->memoryAllocation->limit ?? null, @@ -174,7 +174,7 @@ public function importVApp(string $resourcePoolId, $entityConfig, $instantiation 'shares' => $configSpec->memoryAllocation->shares->shares ?? null, 'level' => $configSpec->memoryAllocation->shares->level ?? null, ] : null, - ], + ] : null, 'extraConfig' => \count($extraConfig) > 0 ? $extraConfig : null, 'bootOptions' => $configSpec->bootOptions ? [ 'bootDelay' => $configSpec->bootOptions->bootDelay ?? null,