Merge pull request #5480 from inspec/vasundhara/small_fix

Minor fix - Method expected to return boolean but it was returning nil if condition check fails
This commit is contained in:
Clinton Wolfe 2021-04-26 22:38:39 -04:00 committed by GitHub
commit 0aef9f11eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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