lib/rubyrun/rubyrun_instrumentor__.rb in rubyrun-0.9.9.2 vs lib/rubyrun/rubyrun_instrumentor__.rb in rubyrun-0.9.9.3
- old
+ new
@@ -185,10 +185,10 @@
# The original method is invoked via 'yield'
# 3. When a method ends, report the timings to the response time component but
# only if a thread local exists
def collect_method_data(obj, klass, mid, *args)
tid = get_thread_id
- create_thread_local(tid, obj.request, klass, mid) if is_rails_controller?(klass)
+ create_thread_local(tid, obj.request, klass, mid) if is_rails_controller?(klass) && obj.respond_to?('request')
rubyrun_trace = is_in?($rubyrun_trace_hash, klass, mid)
if rubyrun_trace
invoker = get_caller_detail
enter_trace(tid, " Entry", obj, invoker, klass, mid, *args)
end
\ No newline at end of file