Skip to content

Commit

Permalink
fix: check props exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Filatov committed Sep 22, 2023
1 parent ef48869 commit 9e03197
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Traits/Soap/SoapImportApis.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,14 @@ public function importVApp(string $resourcePoolId, $entityConfig, $instantiation
'version' => $configSpec->version ?? null,
'uuid' => $configSpec->uuid ?? null,
'guestId' => $configSpec->guestId ?? null,
'files' => $configSpec->files ? new VirtualMachineFileInfo([
'files' => isset($configSpec->files) ? new VirtualMachineFileInfo([
'vmPathName' => $configSpec->files->vmPathName ?? null,
'snapshotDirectory' => $configSpec->files->snapshotDirectory ?? null,
'suspendDirectory' => $configSpec->files->suspendDirectory ?? null,
'logDirectory' => $configSpec->files->logDirectory ?? null,
'ftMetadataDirectory' => $configSpec->files->ftMetadataDirectory ?? null,
]) : null,
'tools' => $configSpec->tools ? new ToolsConfigInfo([
'tools' => isset($configSpec->tools) ? new ToolsConfigInfo([
'toolsVersion' => $configSpec->tools->toolsVersion ?? null,
'toolsInstallType' => $configSpec->tools->toolsInstallType ?? null,
'afterPowerOn' => $configSpec->tools->afterPowerOn ?? null,
Expand All @@ -138,7 +138,7 @@ public function importVApp(string $resourcePoolId, $entityConfig, $instantiation
'lastInstallInfo' => $configSpec->tools->lastInstallInfo ?? null,

]) : null,
'flags' => $configSpec->flags ? new VirtualMachineFlagInfo([
'flags' => isset($configSpec->flags) ? new VirtualMachineFlagInfo([
'disableAcceleration' => $configSpec->flags->disableAcceleration ?? null,
'enableLogging' => $configSpec->flags->enableLogging ?? null,
'useToe' => $configSpec->flags->useToe ?? null,
Expand All @@ -157,7 +157,7 @@ public function importVApp(string $resourcePoolId, $entityConfig, $instantiation
'vvtdEnabled' => $configSpec->flags->vvtdEnabled ?? null,
'vbsEnabled' => $configSpec->flags->vbsEnabled ?? null,
]) : null,
'numCPUs' => $configSpec->numCPUs ?? null,
'numCPUs' => isset($configSpec->numCPUs) ?? null,
'numCoresPerSocket' => $configSpec->numCoresPerSocket ?? null,
'memoryMB' => $configSpec->memoryMB ?? null,
'memoryHotAddEnabled' => $configSpec->memoryHotAddEnabled ?? null,
Expand All @@ -176,7 +176,7 @@ public function importVApp(string $resourcePoolId, $entityConfig, $instantiation
] : null,
] : null,
'extraConfig' => \count($extraConfig) > 0 ? $extraConfig : null,
'bootOptions' => $configSpec->bootOptions ? [
'bootOptions' => isset($configSpec->bootOptions) ? [
'bootDelay' => $configSpec->bootOptions->bootDelay ?? null,
'enterBIOSSetup' => $configSpec->bootOptions->enterBIOSSetup ?? null,
'efiSecureBootEnabled' => $configSpec->bootOptions->efiSecureBootEnabled,
Expand Down

0 comments on commit 9e03197

Please sign in to comment.