diff --git a/lib/puppet_x/icinga2/utils.rb b/lib/puppet_x/icinga2/utils.rb index ce578c1f..4d7f5ca7 100644 --- a/lib/puppet_x/icinga2/utils.rb +++ b/lib/puppet_x/icinga2/utils.rb @@ -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