From 7a0181653b5acececf497bfabf962e5751cde225 Mon Sep 17 00:00:00 2001 From: Bert Hajee Date: Fri, 30 Jul 2021 11:16:43 +0200 Subject: [PATCH] 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 ``` --- lib/puppet-strings/yard/code_objects/type.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/puppet-strings/yard/code_objects/type.rb b/lib/puppet-strings/yard/code_objects/type.rb index 0d8a1fe9c..1535523d3 100644 --- a/lib/puppet-strings/yard/code_objects/type.rb +++ b/lib/puppet-strings/yard/code_objects/type.rb @@ -148,6 +148,7 @@ def add_check(check) end def parameters + @parameters ||= [] # guard against not filled parameters # just return params if there are no providers return @parameters if providers.empty?