handle vm without folder (vapp case)

This commit is contained in:
Colin Gagnaire 2019-06-06 15:47:25 +02:00
parent 8fc55ad522
commit 0576bc8a7f
1 changed files with 1 additions and 1 deletions

View File

@ -150,7 +150,7 @@ sub run {
$vm{type} = "vm";
$vm{name} = $vm->{'config.name'};
$vm{uuid} = $vm->{'config.uuid'};
$vm{folder} = $self->{paths}->{$vm->parent->value} if ($vm->parent->type eq 'Folder');
$vm{folder} = (defined($vm->parent) && $vm->parent->type eq 'Folder') ? $self->{paths}->{$vm->parent->value} : '';
$vm{annotation} = $vm->{'config.annotation'};
$vm{os} = $vm->{'config.guestId'};
$vm{hardware} = $vm->{'config.version'};