aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_view/helpers/benchmark_helper.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/helpers/benchmark_helper.rb b/actionpack/lib/action_view/helpers/benchmark_helper.rb
index ee1f88be82..126f505a98 100644
--- a/actionpack/lib/action_view/helpers/benchmark_helper.rb
+++ b/actionpack/lib/action_view/helpers/benchmark_helper.rb
@@ -11,6 +11,8 @@ module ActionView
#
# Will add something like "Notes section (0.345234)" to the log.
def benchmark(message = "Benchmarking", &block)
+ return if @logger.nil?
+
bm = Benchmark.measure do
block.call
end