diff --git a/lib/newrelic_security/agent/control/collector.rb b/lib/newrelic_security/agent/control/collector.rb index d67383c..e64df31 100644 --- a/lib/newrelic_security/agent/control/collector.rb +++ b/lib/newrelic_security/agent/control/collector.rb @@ -84,6 +84,7 @@ def collect(case_type, args, event_category = nil, **keyword_args) def get_user_frame_index(stk) return -1 if NewRelic::Security::Agent.config[:app_root].nil? stk.each_with_index do |val, index| + next if stk[index + 1] && stk[index + 1].path.start_with?(NewRelic::Security::Agent.config[:app_root]) return index if val.path.start_with?(NewRelic::Security::Agent.config[:app_root]) end return -1