Merge pull request #500 from chef/dr/metadata-bug

don't crash on empty metadata during finalize
This commit is contained in:
Christoph Hartmann 2016-02-26 17:25:06 +01:00
commit 5d10c2208b

View file

@ -140,6 +140,7 @@ module Inspec
end
def self.finalize(metadata, profile_id)
return nil if metadata.nil?
param = metadata.params || {}
param['name'] = profile_id.to_s unless profile_id.to_s.empty?
param['version'] = param['version'].to_s unless param['version'].nil?