Skip to content

Commit 157ed92

Browse files
authored
Merge pull request #430 from puppetlabs/gh-422-fix_nil_error_on_ref
(GH-422) - Add Safe Navigation Operator to hash['ref']
2 parents ce3a8e2 + b545f3f commit 157ed92

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/puppetlabs_spec_helper/tasks/fixtures.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def validate_fixture_hash!(hash)
151151
return hash unless hash['scm'] == 'git'
152152

153153
# Forward slashes in the ref aren't allowed. And is probably a branch name.
154-
raise ArgumentError, "The ref for #{hash['target']} is invalid (Contains a forward slash). If this is a branch name, please use the 'branch' setting instead." if hash['ref'].include?('/')
154+
raise ArgumentError, "The ref for #{hash['target']} is invalid (Contains a forward slash). If this is a branch name, please use the 'branch' setting instead." if hash['ref']&.include?('/')
155155

156156
hash
157157
end

0 commit comments

Comments
 (0)