summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPranay Singh <i5singh.pranay@gmail.com>2022-05-12 14:40:44 +0530
committerPranay Singh <i5singh.pranay@gmail.com>2022-05-12 14:40:44 +0530
commitbad9fad5fef1f76407d3cbb20994df37b1ac5f28 (patch)
tree0282eaaf57cce96d20b581a9fe0213ae89d32136
parentbf51df45162be5543fe142013080a7601399a1d7 (diff)
downloadchef-bad9fad5fef1f76407d3cbb20994df37b1ac5f28.tar.gz
handling exception in other collections
Signed-off-by: Pranay Singh <i5singh.pranay@gmail.com>
-rw-r--r--lib/chef/compliance/input_collection.rb2
-rw-r--r--lib/chef/compliance/waiver_collection.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/compliance/input_collection.rb b/lib/chef/compliance/input_collection.rb
index 034943f8d9..a3e55c5f6a 100644
--- a/lib/chef/compliance/input_collection.rb
+++ b/lib/chef/compliance/input_collection.rb
@@ -40,7 +40,7 @@ class Chef
def from_file(filename, cookbook_name)
new_input = Input.from_file(events, filename, cookbook_name)
self << new_input
- events.compliance_input_loaded(new_input)
+ events&.compliance_input_loaded(new_input)
end
# Add a input from a raw hash. This input will be enabled by default.
diff --git a/lib/chef/compliance/waiver_collection.rb b/lib/chef/compliance/waiver_collection.rb
index a3d12b3a97..68dce07287 100644
--- a/lib/chef/compliance/waiver_collection.rb
+++ b/lib/chef/compliance/waiver_collection.rb
@@ -40,7 +40,7 @@ class Chef
def from_file(filename, cookbook_name)
new_waiver = Waiver.from_file(events, filename, cookbook_name)
self << new_waiver
- events.compliance_waiver_loaded(new_waiver)
+ events&.compliance_waiver_loaded(new_waiver)
end
# Add a waiver from a raw hash. This waiver will be enabled by default.