Skip to content

Commit 2d1ccca

Browse files
committed
Fix configuration_script/show record with missing values
If not all properties of a `configuration_script` were present this page was throwing an exception.
1 parent 1a9995f commit 2d1ccca

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/helpers/configuration_script_helper.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ def textual_configuration_script_region
1717
end
1818

1919
def textual_group_variables
20+
return unless @record.variables
21+
2022
variables = Array(@record.variables).collect do |item|
2123
[
2224
item[0].to_s,
@@ -32,7 +34,7 @@ def textual_group_variables
3234
end
3335

3436
def textual_group_surveys
35-
return unless @record.survey_spec['spec']
37+
return unless @record.survey_spec&.key?('spec')
3638

3739
headers = [_('Question Name'), _('Question Description'), _('Variable'),
3840
_('Type'), _('Min'), _('Max'), _('Default'), _('Required'), _('Choices')]

0 commit comments

Comments
 (0)