diff options
author | Tim Smith <tsmith@chef.io> | 2021-06-13 11:13:10 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-13 11:13:10 -0700 |
commit | a5c04443634b7a780a764191f3a80bed2c8c2218 (patch) | |
tree | 5598a085596a3618e1901b263f9c0a88aecfaa2c /lib | |
parent | 207e77d00a1561ab704e5dd7bf23c874e3b70dfd (diff) | |
parent | ad9d197649a05d3917ed2799d9cdec689b7edc9e (diff) | |
download | chef-a5c04443634b7a780a764191f3a80bed2c8c2218.tar.gz |
Merge pull request #11691 from fuegas/master
Handle source_line being nil gracefully
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/handler/slow_report.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/handler/slow_report.rb b/lib/chef/handler/slow_report.rb index 7bb472f4d5..e5b2f2895f 100644 --- a/lib/chef/handler/slow_report.rb +++ b/lib/chef/handler/slow_report.rb @@ -59,7 +59,7 @@ class Chef def stripped_source_line(resource) # strip the leading path off of the source line - resource.source_line.gsub(%r{.*/cookbooks/}, "").gsub(%r{.*/chef-[0-9\.]+/}, "") + resource.source_line&.gsub(%r{.*/cookbooks/}, "")&.gsub(%r{.*/chef-[0-9\.]+/}, "") end end end |