lib/rbvmomi/vim/ManagedObject.rb in rbvmomi-1.6.0 vs lib/rbvmomi/vim/ManagedObject.rb in rbvmomi-1.8.0
- old
+ new
@@ -33,10 +33,15 @@
:propSet => [{
:pathSet => pathSet,
:type => self.class.wsdl_name
}]
}
- _connection.propertyCollector.RetrieveProperties(:specSet => [spec])[0].to_hash
+ ret = _connection.propertyCollector.RetrieveProperties(:specSet => [spec])
+ if ret && ret.length > 0
+ ret[0].to_hash
+ else
+ {}
+ end
end
# Efficiently retrieve multiple properties from an object.
# @param pathSet (see #collect!)
# @yield [*values] Property values in same order as +pathSet+.