Skip to content

Commit 7a01816

Browse files
hajeesanfrancrisko
authored andcommitted
Fix rare undefined method `any?' for nil:NilClass error. Fixes #287
In some rare cases where no parameter is (yet) defined in the type, an error is thrown ``` Error: undefined method `any?' for nil:NilClass ```
1 parent 3ce39ac commit 7a01816

File tree

1 file changed

+1
-0
lines changed
  • lib/puppet-strings/yard/code_objects

1 file changed

+1
-0
lines changed

lib/puppet-strings/yard/code_objects/type.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ def add_check(check)
148148
end
149149

150150
def parameters
151+
@parameters ||= [] # guard against not filled parameters
151152
# just return params if there are no providers
152153
return @parameters if providers.empty?
153154

0 commit comments

Comments
 (0)