This function was only returning boolean if profile_config_exist and was returning nil if condition was failed so updated the method to return false

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
This commit is contained in:
Vasu1105 2021-04-23 13:59:36 +05:30
parent 12bd7a2c48
commit 3725aa4598

View file

@ -194,6 +194,7 @@ module Inspec
# Check if the given control exist in the --controls option
def control_exist_in_controls_list?(id)
id_exist_in_list = false
if profile_config_exist?
id_exist_in_list = @conf["profile"].include_controls_list.any? do |inclusion|
# Try to see if the inclusion is a regex, and if it matches