From 7cdb710e5e1cbf0a1e5f4a25ccae883659fc069f Mon Sep 17 00:00:00 2001 From: Dominik Richter Date: Fri, 26 Feb 2016 10:26:57 +0100 Subject: [PATCH] dont crash on empty metadata during finalize --- lib/inspec/metadata.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/inspec/metadata.rb b/lib/inspec/metadata.rb index f22a68edd..3accbb99c 100644 --- a/lib/inspec/metadata.rb +++ b/lib/inspec/metadata.rb @@ -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?