aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuc Donnet2018-04-08 22:23:28 +0200
committerLuc Donnet2018-04-08 22:23:45 +0200
commit602b8f898cb83d72823da0c19fc496bc719bb73a (patch)
tree543233a1666db3a10e018faaf8883cca7628a485
parent1702598111630f8bad9003241ce1d002028a4054 (diff)
downloadchouette-core-602b8f898cb83d72823da0c19fc496bc719bb73a.tar.bz2
Fix test when control_attributes or keys not exist Refs #6177 @1
-rw-r--r--app/helpers/compliance_controls_helper.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/helpers/compliance_controls_helper.rb b/app/helpers/compliance_controls_helper.rb
index 297ae3afa..abf909929 100644
--- a/app/helpers/compliance_controls_helper.rb
+++ b/app/helpers/compliance_controls_helper.rb
@@ -11,7 +11,7 @@ module ComplianceControlsHelper
def compliance_control_metadatas(compliance_control)
attributes = resource.class.dynamic_attributes
- attributes.push(*resource.control_attributes.keys) if resource.respond_to? :control_attributes
+ attributes.push(*resource.control_attributes.keys) if resource&.control_attributes&.keys
{}.tap do |hash|
attributes.each do |attribute|
@@ -19,4 +19,4 @@ module ComplianceControlsHelper
end
end
end
-end
+end