summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2021-06-13 11:13:10 -0700
committerGitHub <noreply@github.com>2021-06-13 11:13:10 -0700
commita5c04443634b7a780a764191f3a80bed2c8c2218 (patch)
tree5598a085596a3618e1901b263f9c0a88aecfaa2c /lib
parent207e77d00a1561ab704e5dd7bf23c874e3b70dfd (diff)
parentad9d197649a05d3917ed2799d9cdec689b7edc9e (diff)
downloadchef-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.rb2
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