Skip to content

Commit

Permalink
fix #711 Object#=~ is called on TrueClass
Browse files Browse the repository at this point in the history
  • Loading branch information
lbetz committed Oct 14, 2022
1 parent 04e2fe1 commit 0dc04ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/puppet_x/icinga2/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def self.attributes(attrs, globals, consts, indent = 2)
elsif value.is_a?(Array)
op = value.delete_at(0) if value[0] == '+' || value[0] == '-'
"%{ind}%{att} #{op}= [ %{lst}]\n" % { ind: ' ' * indent, att: attr, lst: process_array(value) }
elsif value =~ %r{^([\+,-])\s+}
elsif value && value =~ %r{^([\+,-])\s+}
# String: attr = '+ config' -> attr += config
"%{ind}%{att} #{Regexp.last_match(1)}= %{expr}\n" % { ind: ' ' * indent, att: attr, expr: parse(value.sub(%r{^[\+,-]\s+}, '')) }
else
Expand Down

0 comments on commit 0dc04ff

Please sign in to comment.